.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> .Net Framework >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Data Adapters

Posted By:Shashi Ray       Posted Date: October 01, 2008    Points: 10    Category: .Net Framework    URL: http://www.dotnetspark.com  
 

 

Data adapters

A DataAdapter is the object that bridges between the source data and the DataSet object so retrieves and updates can occur.

Key properties

·         AcceptChangesDuringFill: (read/write) a value indicating whether AcceptChanges is called on a DataRow after it is added to the DataTable.

·         TableMappings: (read) a collection that provides the master mapping between a source table and a DataTable.

Key methods

·         Fill: adds or refreshes rows in the DataSet to match those in the data source using the DataSet name, and creates a DataTable named "Table."

·         FillSchema: adds a DataTable named "Table" to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType.

·         GetFillParameters: retrieves the parameters set by the user when executing a SQL select statement.

Update: Calls the respective insert, update, or delete statements for respective action in the specified DataSet from a DataTable named "Table."


 Subscribe to Articles

     

Further Readings:

Responses
Author: Ruchi         Company URL: http://www.dotnetspark.com
Posted Date: November 14, 2008

I have read that a dataset can handle multiple tables. Can you please explain that in detail? I dont know how it can be done practically.
Author: Shashi Ray         Company URL: http://www.dotnetspark.com
Posted Date: November 16, 2008

string test = "select abc,def from shashi; select ab,cd from ray";
DataSet ds = new DataSet();
ds = cls.populate(test);

TextBox1.Text=ds.Tables[0].Rows[0][0].ToString().Trim();
TextBox2.Text=ds.Tables[0].Rows[0][1].ToString().Trim();
TextBox3.Text=ds.Tables[1].Rows[0][0].ToString().Trim();
TextBox4.Text=ds.Tables[1].Rows[0][1].ToString().Trim();


//ds.Tables[0];
//ds.Tables[1];

Try this Code.
Shashi Kant Ray
Author: Athira Sreejith         Company URL: http://www.dotnetspark.com
Posted Date: April 08, 2009

Hi..

You can try like this also..

string test = "select abc,def from shashi; select ab,cd from ray";
DataSet ds = new DataSet();
ds = cls.populate(test);

TextBox1.Text=ds.Tables[0].Rows[0].ItemArray[0].ToString();
TextBox2.Text=ds.Tables[0].Rows[0].ItemArray[1].ToString();
TextBox3.Text=ds.Tables[1].Rows[0].ItemArray[0].ToString();
TextBox4.Text=ds.Tables[1].Rows[0].ItemArray[1].ToString();

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend