views:

34

answers:

2

Hi there,

I m trying loading data table from xml schema. I can see column names on datatable but, i cant see datas. here is my code:

   StringReader sr = new StringReader(dsSorgu.Tables[0].Rows[i]["sorguSonucu"].ToString());
   s.M_Sonucu = new DataTable();
   s.M_Sonucu.ReadXmlSchema(sr);
   srgKullaniciSorgulari.Add(s);

sr contains xml schema.

A: 

"An XML Schema describes the structure of an XML document."

http://www.w3schools.com/schema/default.asp

If it is a schema it should not have data in it. You need another file with the data in it and the schema can be used to validate that file if necessary.

http://www.w3schools.com/schema/schema_intro.asp See: What is an XML Schema?

Jaydee
+1  A: 

An xml schema doe not contain any data, just table, relation, and constraint definitions. You will need to call the ReadXml method to load the actual data (which will be validated by your schema).

Rewinder