ado.net - How to create a DataTable in C# and how to add rows? -
How to create a DataTable in C #?
I liked it:
Datatable DT = new datatile (); Dt.clear (); Dt.Columns.Add ("name"); Dt.Columns.Add ("icon");
How do I view the structure of Datatelle?
Now I want to add ravi to name
and 500 for marks
. How can I do this?
Here is the code:
DataTable DT = new datatable () ; Dt.Clear (); Dt.Columns.Add ("name"); Dt.Columns.Add ("icon"); Datarao_Ravi = DT. NRO (); _ravi ["name"] = "sun"; _ravi ["mark"] = "500"; Dt.Rows.Add (_ravi);
To see the structure, or instead of rewriting it as schema, you can export it in XML file.
To only export schema / structure, do:
dt.WriteXMLSchema ("dtSchemaOrStructure.xml");
In addition, you can also export your data:
dt.WriteXML ("dtDataxml");
Comments
Post a Comment