Saturday, July 22, 2006

What if I fill my DataSet using an XML file rather then Database, sounds interesting...let's have a look

private void Page_Load(object sender, System.EventArgs e)
{
    DataSet dstObject = new DataSet() ;
    dstObject.ReadXml(MapPath("./MyXMLFile.xml")) ;
    Repeater1.DataSource = dstObject ;
    Repeater1.DataBind() ;
}

Easy, ain't it? try and have fun.

Cheers,

 

7/25/2006 5:32:04 AM UTC
Its not just limited to that, you can even link both of your XML files data tables and your SQL Data tables and then query for records based on the relationship. Also this ReadXML statement also decipher the XML structure automatically and creates the table accordingly.

Use the DataSet.Relations object to create the relationships.

Its preety interesting stuff i must say.

Saad
7/25/2006 12:55:51 PM UTC
There is a BIG Typo on your Blog Title


practises

should be

practices

7/26/2006 7:45:00 AM UTC
Saad,

Thanks for providing such valuable information. Hope other people who are reading the same have noticed the same through comments.

I fully agreed with your idea of creating relations through the same and at the same time creating a combine statement before issuing.

I like you comment on the upcoming blogs too.

Thanks.
~Danish
7/27/2006 5:56:56 AM UTC
I am already on top of it but is it just me who puts comments here or ... is it just me ? Not sure if that concludes to the number of people reading this blog.

I have added your blog in my everyday viewing website list so i check it everyday.

Saad

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):