Asp.net, vb.net, C#.net Resources

Welcome to Asp.net, vb.net, C#.net Resources Sign in | Join | Help
in Search

How to read data from the XML file using FileStream?

Last post 09-13-2006, 12:54 PM by admin. 1 replies.
Sort Posts: Previous Next
  •  09-08-2006, 1:40 AM 1618

    How to read data from the XML file using FileStream?

    hai,

    How to read data from the XML file using FileStream and store the one of the  content of a element in variable by using a Switch and only one case in C#.

  •  09-13-2006, 12:54 PM 1622 in reply to 1618

    Re: How to read data from the XML file using FileStream?

    How to read data from an XML file and display it in a DataGrid?

    VB.NET


    dim ds as new DataSet()
    ds.ReadXml (Server.MapPath ("products.xml"))
    DataGrid1.DataSource =ds
    DataGrid1.DataBind()


    C#


    DataSet ds= new DataSet ();
    ds.ReadXml (Server.MapPath ("products.xml"));
    DataGrid1.DataSource =ds;
    DataGrid1.DataBind();


    How to read data from the XML file using FileStream and display it in a DataGrid?

    Use namespace System.IO
    VB.NET


    dim ds as new DataSet()
    dim fs as FileStream = new FileStream (Server.MapPath ("products.xml"),FileMode.Open , FileAccess.Read )
    ds.ReadXml (fs)
    DataGrid1.DataSource = ds
    DataGrid1.DataBind ()


    C#


    DataSet ds= new DataSet ();
    FileStream fs = new FileStream (Server.MapPath ("products.xml"),FileMode.Open , FileAccess.Read );
    ds.ReadXml (fs);
    DataGrid1.DataSource = ds;
    DataGrid1.DataBind ();


    How to write the data from database into an XML file?

    VB.NET


    'Fill the DataSet
    ds.WriteXml(Server.MapPath ("products.xml" ) )


    C#


    //Fill the DataSet
    ds.WriteXml(Server.MapPath ("products.xml" ) );


    Note : Make sure you have write and modify rights.

    Filed under: , , , ,
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems