Creating Datarow

A

Arne

I can add a datacolumn to a datarow at any time.
How can I add a datarow to a table in a dataset?
 
E

Elton Wang

DataColumn col = New DataColumn("colName",Type.GetType("System.String");
datatable.Columns.Add(col);

DataRow row = datatable.NewRow();
// assign data to the row
datatable.Rows.Add(row);


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

C# DataTable 1
DataRow? 1
ObjectDataSource and the DataRow 1
Delete rows in Gridview 0
DataRow 5
e.dataItem with XML problem. 2
Q: copy of a datarow 6
Create and open Excel spreadsheet from ASP.NET 2

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top