ADO.Net Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 813 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 thjNmj
Related Questions
ADO.Net : How can we force the Connection object to close after DataReader object is closed?

How can we force the Connection object to close after DataReader object is closed?

We use ExecuteReader method of Command object to get the DataReader object. This ExecuteReader metho....
Category: ADO.Net Date: 10/6/2009 6:34:42 AM
ADO.Net : How to make decision about using DataSet over DataReader?

How to make decision about using DataSet over DataReader?

Use a DataSet when you need to do following: 1) Navigate between multiple discrete tables of resul....
Category: ADO.Net Date: 10/6/2009 5:56:34 AM
ADO.Net : What is the difference between DataSet and DataReader?

What is the difference between DataSet and DataReader?

Following are some major differences between DataSet and DataReader: 1) DataReader provides forward....
Category: ADO.Net Date: 10/6/2009 5:47:03 AM
ADO.Net : What is a DataReader object?

What is a DataReader object?

DataReader object provides a read-only, forward-only stream of data from a database. The DataReader ....
Category: ADO.Net Date: 10/6/2009 5:35:46 AM
ADO.Net : What are the advantages of ADO.Net?

What are the advantages of ADO.Net?

ADO.Net offers following benefits: 1) XML is the format for transmitting datasets across the networ....
Category: ADO.Net Date: 10/6/2009 5:17:57 AM