0

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

1
  • 1
    I'm trying to understand what you need to do. Are you sure you're talking about xsd and not xls? Do you want a datatable in a Schema file? For validating an XML file? Commented Nov 11, 2013 at 7:20

1 Answer 1

1

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");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.