kya baat hain...waah ustaad waahh

Krunal Chaklasia <[EMAIL PROTECTED]> wrote:Check it out this code,


Database db = DatabaseFactory.CreateDatabase(); 

DBCommandWrapper selectCommandWrapper = 
db.GetStoredProcCommandWrapper("sp_GetLatestArticles"); 



DataSet ds = db.ExecuteDataSet(selectCommandWrapper); 

StringBuilder str = new StringBuilder(); 

for(int i=0;i<=ds.Tables[0].Rows.Count - 1; i++) 

{

for(int j=0;j<=ds.Tables[0].Columns.Count - 1; j++) 

{

str.Append(ds.Tables[0].Rows[i][j].ToString()); 

}

str.Append("<BR>");

}

Response.Clear();

Response.AddHeader("content-disposition", "attachment;filename=FileName.txt");

Response.Charset = "";

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.ContentType = "application/vnd.text";

System.IO.StringWriter stringWrite = new System.IO.StringWriter();

System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

Response.Write(str.ToString());

Response.End();



KRUNAL CHAKLASIA

HCL Technologies.




Nirmal Abraham <[EMAIL PROTECTED]> wrote:
Sir,
I want to export the Datagrid to textfile in asp.net.
Please help me sir.


---------------------------------
Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.com

[Non-text portions of this message have been removed]





Yahoo! Groups Links







            
---------------------------------
Start your day with Yahoo! - make it your home page 

[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "AspNetAnyQuestionIsOk" on the web.
  
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


---------------------------------




                
---------------------------------
 Start your day with Yahoo! - make it your home page 

[Non-text portions of this message have been removed]






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to