Having a problem adding a table to a dataset, watching in debugger I read xml file into datatable all looks fine, when add datatabe to dataset table/dataset ( using dataviewer ) first record looks good remaining records/fields contain a red ! mark.
fs = new FileStream(Server.MapPath(GlobalVar.compathver), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
DataTable CommentTable = new DataTable("Comment");
CommentTable.Columns.Add("ID",Type.GetType("System.Int32"));
CommentTable.Columns.Add("Author",Type.GetType("System.String"));
CommentTable.Columns.Add("Date",Type.GetType("System.String"));
CommentTable.Columns.Add("Text", Type.GetType("System.String"));
CommentTable.ReadXml(fs);
dset.Tables.Add(CommentTable);
fs.Close();
<?xml version="1.0" encoding="utf-8"?>
<CommentItems>
<Comment id="1">
<ID>1</ID>
<Author>Billy</Author>
<Date>05/22/2009</Date>
<Text>
Comments about Bills Blog.
</Text>
</Comment>
<Comment id="3">
<ID>3</ID>
<Author>Samanth</Author>
<Date>05/31/2009</Date>
<Text>
Comments about Sams Blog.
</Text>
</Comment>
<Comment id="4">
<ID>4</ID>
<Author>BillBoy</Author>
<Date>06/22/2009</Date>
<Text>
Comments about Bills Blog.
</Text>
</Comment>
<Comment id="4">
<ID>4</ID>
<Author>Bill</Author>
<Date>05/21/2009</Date>
<Text>
Comments about Lees Blog.
</Text>
</Comment>
<Comment id="3">
<ID>3</ID>
<Author>Bill</Author>
<Date>6/3/2009 2:29:54 PM</Date>
<Text>Bill's comment</Text>
</Comment>
<Comment id="4">
<ID>4</ID>
<Author>Bill</Author>
<Date>05/25/2009</Date>
<Text>
Comments about Not Not Not Bills Blog.
</Text>
</Comment>
</CommentItems>