C#.netsuraj Bhoir13yAsked May 16, 2013, 1:17 AM EDT1 answerShareLinkedInXCopy linkSaveHow we can declar the data row1 AnswerKnow the answer? Post it. Somebody with the same question will find it here.Sandeep Singh ShekhawatRank #147 · 15.6K points13y agoPosted May 16, 2013, 1:32 AM EDT0private void CreateNewDataRow() { // below to create a new table. DataTable table = new DataTable();//Add Columns to table table.Columns.Add("fName", typeof(string)); table.Columns.Add("lName", typeof(string)); // Once a table has been created, use the // NewRow to create a DataRow. DataRow row; row = table.NewRow(); // Then add the new row to the collection. row["fName"] = "John"; row["lName"] = "Smith"; table.Rows.Add(row); //now use table as data source }0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign in
C#.netsuraj Bhoir13yAsked May 16, 2013, 1:17 AM EDT1 answerShareLinkedInXCopy linkSaveHow we can declar the data row
Sandeep Singh ShekhawatRank #147 · 15.6K points13y agoPosted May 16, 2013, 1:32 AM EDT0private void CreateNewDataRow() { // below to create a new table. DataTable table = new DataTable();//Add Columns to table table.Columns.Add("fName", typeof(string)); table.Columns.Add("lName", typeof(string)); // Once a table has been created, use the // NewRow to create a DataRow. DataRow row; row = table.NewRow(); // Then add the new row to the collection. row["fName"] = "John"; row["lName"] = "Smith"; table.Rows.Add(row); //now use table as data source }0
Sandeep Singh ShekhawatRank #147 · 15.6K pointsPosted May 16, 2013, 1:32 AM EDT
{
// below to create a new table.
DataTable table = new DataTable();
//Add Columns to table
table.Columns.Add("fName", typeof(string));
table.Columns.Add("lName", typeof(string));
// Once a table has been created, use the
// NewRow to create a DataRow.
DataRow row; row = table.NewRow();
// Then add the new row to the collection.
row["fName"] = "John";
row["lName"] = "Smith";
table.Rows.Add(row);
//now use table as data source
}