List Info

Thread: C-Sharp (C#) Group: Re: How to let the datagrid display the XML string?




C-Sharp (C#) Group: Re: How to let the datagrid display the XML string?
user name
2006-02-17 15:21:03
Hi guru,
Here's the code snippet.
System.Xml.XmlTextReader reader =
new System.Xml.XmlTextReader(returnParm,
System.Xml.XmlNodeType.Element, null);

DataSet ds = new DataSet();
ds.ReadXml(reader);
this.dataGrid1.DataSource = ds;
this.dataGrid1.DataMember = "Return";

Try it out. Remember "Return" must have atleast
one child node.
If you need any help lemme know.
Arindam


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

C-Sharp (C#) Group: Re: How to let the datagrid display the XML string?
user name
2006-02-20 01:58:52
very thx Arindam,

       Now I met another problem, when the returnParm like
below :

          returnParm = "<?xml
version=\"1.0\" ?><Return>";
          returnParm +=
"<test>Hellow</test>";
          returnParm +="</Return>";
          ......

          DataTable dtInfo = new DataTable();
          dtInfo = ds.Tables[0];

       it's wrong use the " string strTest =
ds.Rows[0]["test"].ToString().Trim();"
       it seems column "test" does not exist.
why?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )