| Author: Antony s Nasarath 05 Oct 2008 | Member Level: Silver | Rating:  Points: 2 |
Hi,
Dataset consists of one or more datatable and as you know, datatable contains rows and columns as in normal table.
You can get datatable from dataset as follows (C# code) DataTable tbl = DataSet.Tables["Tablename" or Table instance number]
Cheers,
|
| Author: amitkumar 05 Oct 2008 | Member Level: Gold | Rating: Points: -20 |
HI, 1)Data table is a collection of record's that consist the single table
Whenever dataset is collection of data table and it is provide interface between database and datatable 1 dataset consist multiple table. 2) Dataset: Represents an in-memory cache of data.
Datatable: Represents one table of in-memory data.
|
| Author: Anand Upadhyay 06 Oct 2008 | Member Level: Bronze | Rating: Points: -20 |
A Dataset is a in memory representation of a collection of Database objects including tables of a relational database scheme. The dataset contains a collection of Tables, Relations, constraints etc.,
It can be used for manipulating the data remotely and finally updating the database with the modified data. This way it enables disconnected means of working with data. This improves performance in terms of reducing the number of times a database is accessed for data manipulations
The dataset contains all the objects as a Collection of objects. For example it contains the Database Tables as DataTable objects
using System.Data.SqlClient; using System.Data;
string strDBConnection = "server=(local);database=DatabaseName;user id=UserName;password=Pwd;connection reset=false;connection lifetime=5;Trusted_Connection=Yes;" SqlConnection dbConnection; dbConnection = new SqlConnection(strDBConnection);
string strSelectSql = "Select * from [DatabaseName].[OwnerName].[TableName] order by FieldName";
//Open the connection dbConnection.Open();
//Create a command SqlCommand selectSqlCommand = new SqlCommand(strSelectSql,dbConnection); SqlDataAdapter sqlData = new SqlDataAdapter(selectSqlCommand); DataSet dsSelectData = new DataSet(); sqlData.Fill(dsSelectData);
|