data table
how manually create the table in windows form application?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Apr 19, 2011, 5:19 PM
Blocked AccountPosted Apr 19, 2011, 4:26 AM
First of all add the namespace System.Data;
DataTable dataTable = new DataTable();
dataTable.Columns.Add("Name", typeof(string));
dataTable.Columns.Add("City", typeof(string));
dataTable.Columns.Add("Age", typeof(int));
// Here I add three DataRows.
dataTable.Rows.Add("Manish", "New Delhi", 28);
dataTable.Rows.Add("Santosh", "Noida", 35);
dataTable.Rows.Add("Puru", "Firojabad", 29);
now your datatable is ready for use.