Sunday, March 11, 2012

Add rows to a DataSet without updating the MS SQL Server?

I am using ASP.NET 2.0 WebForms and I was trying to use a DataSet to add rows programatically without adding the actual records to the MS SQL Server Databases. Is this possible or should I be doing this another way?

DataSet myDS =newDataSet();
DataTable myTable =newDataTable("table1");
myTable.Columns.Add("col1",typeof(string));
myDS.Tables.Add(myTable);
myTable.Rows.Add("MyValue");

Thanks.

Yes it is possible.

No comments:

Post a Comment