Bind DataList with multiple tables in dataset
i have a Datase开发者_如何学Got with 4 tables , i m assigning this Dataset to datalist. i want to bind some fields from all tables in the datalist. Write now its only binding the Table which is on 0 index of dataset, on other table column name its giving exception.
How to bind the datalist with multiple table in dataset.?
Thanks,
You can merge the DataTables that are inside the DataSet and then bind to datalist
DataTable dtblFinal = new DataTable();
foreach (DataTable table in dataset.Tables)
{
dtblFinal.Merge(table, false, MissingSchemaAction.Add);
}
加载中,请稍侯......
精彩评论