Reputation: 85
I need to create a datatable by writing code in xsd file not by using exixting datatable in xsd file.when right click on xsd file---Add---Datatable. But I don't want to use this,I want to write some code for creating the datatable. I am not getting idea to solve this problem,please help in solving this. Thanks
Upvotes: 0
Views: 4156
Reputation: 26
Create a DataTable
:
DataTable dt = new DataTable();
dt.TableName = "Sample";
dt.Columns.Add("Column1");
dt.Columns.Add("Column2");
dt.Columns.Add("Column3");
dt.Columns.Add("Column4");
dt.WriteXmlSchema(@"D:Project1\example.xsd");
Upvotes: 1