Wednesday, August 18, 2010

How to bind a table by reading text file using data grid in asp.net 1.1 using c# ? Thanks.?

As I know, I usually bind a table from the database. But now I wanna bind a table by reading the content from a textfile. It is using datagrid. Can someone help me? Thank u.How to bind a table by reading text file using data grid in asp.net 1.1 using c# ? Thanks.?
You can do it relatively easy if your file is an XML.


In your version of C# it would look something like this:





System.Xml.XmlReader myXMLreader =


new System.Xml.XmlTextReader(


new System.IO.StreamReader(%26lt;filename%26gt;)


);


DataSet myDataSet = new DataSet();


myDataSet.ReadXml(myXMLreader);


myGrid.DataSource = myDataSet.Tables[0];


myGrid.DataBind();
  • love myspace
  • myspace girl
  • No comments:

    Post a Comment