ADO.Net Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 897 Page Views: 

How do you create dataset object and populate it with data from c# code?



Posted By: Avi Date: 14 October 2010 01:54:47 PM
 Answer:

DataSet ds = new DataSet(); ds.Tables.Add(new DataTable()); ds.Tables[0].Columns.Add(“col1”); ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());


Posted By: avibtech


Date: 14 October 2010 01:54:47 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image mScV3U
Related Questions
ADO.Net : Can you serialize dataset instance?

Can you serialize dataset instance?

yes
Category: ADO.Net Date: 10/13/2010 11:37:48 PM
ADO.Net : Can you reuse an exisiting open ADO.NET connection with LINQ to SQL?
ADO.Net : To what type ntext type will be mapped in c# code?

To what type ntext type will be mapped in c# code?

SqlTypes.SqlString
Category: ADO.Net Date: 10/13/2010 8:08:47 PM
ADO.Net : Does Recordset exists in ADO.NET?

Does Recordset exists in ADO.NET?

No
Category: ADO.Net Date: 10/13/2010 7:15:48 PM
ADO.Net : How can you fill data set with multiple tables?

How can you fill data set with multiple tables?

Provide two or more queries separated by ; to SqlDataAdapter and use it to fill dataset.
Category: ADO.Net Date: 10/13/2010 5:21:47 PM