CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010
    Posts
    2

    create zip file from csv in asp.net

    Anyone can tell , how will i create a zip file of below csv generated code..what is the code for that?
    Thanks in advance

    my .csv generated code is.....


    if (RadioButtonList1.SelectedItem.Text == "CSV")

    {
    Response.Clear();

    Response.Buffer = true;
    Response.AddHeader("content-disposition", "attachment;filename=DataTable.csv");
    Response.Charset = "";
    Response.ContentType = "application/text";
    StringBuilder sb = new StringBuilder();
    for (int k = 0; k < dtTemp.Columns.Count; k++)
    {

    sb.Append(dtTemp.Columns[k].ColumnName + ',');
    }

    sb.Append("\r\n");
    for (int i = 0; i < dtTemp.Rows.Count; i++)
    {
    for (int k = 0; k < dtTemp.Columns.Count; k++)
    {

    sb.Append(dtTemp.Rows[i][k].ToString().Replace(",", ";") + ',');
    }

    sb.Append("\r\n");
    }
    Response.Output.Write(sb.ToString());

    Response.Flush();

    Response.End();


    }

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: create zip file from csv in asp.net

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Nov 2010
    Posts
    2

    Re: create zip file from csv in asp.net

    i want to convert csv file to zip file..how will be that ?.i dnt have any idea..plzz.it is very urgent..i generated csv code from above code..help me any expert? Thanks in advance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured