how to create CSV


hi

im using code  error show in line (stringbuilder sb = new stringbuilder(); ) can u plz give me stringbuilder class

            response.clear();

            response.buffer =

true;

            response.addheader(

"content-disposition",

            

"attachment;filename=gridviewexport.csv");

            response.charset =

"";

            response.contenttype =

"application/text";

            dgporesult.allowpaging =

false;

            dgporesult.databind();

            stringbuilder sb =

new stringbuilder();

          

           

for (int k = 0; k < dgporesult.columns.count; k++)

            {

               

//add separator



                sb.append(dgporesult.columns[k].headertext +

',');

            }

           

//append new line



            sb.append(

"\r\n");

           

for (int = 0; < dgporesult.rows.count; i++)

            {

               

for (int k = 0; k < dgporesult.columns.count; k++)

                {

                   

//add separator



                    sb.append(dgporesult.rows[i].cells[k].text +

',');

                }

               

//append new line



                sb.append(

"\r\n");

            }

            response.output.write(sb.tostring());

            response.flush();

            response.end();

in case aren't still aware, @ wrong place it's visual basic forum.

onion recent refuge mac os x , hates mac app store. system: windows 7 x64



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user