Click here to Skip to main content
15,889,651 members

Comments by sathish.jampala (Top 21 by date)

sathish.jampala 7-Mar-11 7:33am View    
hello sir. thanks for ur quick reply.
this is showing the same output. no files are displaying in gridview.
gridview is displaying empty with heading only.
sathish.jampala 7-Mar-11 0:04am View    
tanks for ur reply.
i have a folder contained multiple textfiles. i want to read those files and bind to gridview. i write following code

string[] files = Directory.GetFiles("E:\\DOTNET APPLICATIONS\\Asp.net\\TextfilestoGrid\\TextFolder\\");
foreach (string file in files)
{
Stream msgStream = File.Open(file, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(msgStream);
string str = sr.ReadToEnd();
//ArrayList al = new ArrayList();

DataTable dt = new DataTable();
dt.Columns.Add("TextFiles");
DataRow dr = dt.NewRow();
dr["TextFiles"] = str;
dt.Rows.Add(dr);
sr.Close();
msgStream.Close();

GV.DataSource = dt;
GV.DataBind();

when ever i debug the application, all files are coming to stream object but they are not binded to gridview. output is displaying only one columnname that is "TextFiles" with no data.
plz help me;
thanking you.
sathish.jampala 6-Mar-11 8:15am View    
thank you sir.
sathish.jampala 1-Mar-11 5:26am View    
thanks for ur quick reply.
how to create a project in my website sir.
sathish.jampala 1-Mar-11 5:25am View    
thanks for ur quick reply.