Steps to Work With Dataset:


(1) Declare Data Adapter
Sy:-Class Name Object Name
Ex:-SqlDataAdapter Da;

(2) Declare Dataset object
Sy:-ClassName  ObjectName
Ex:-Dataset Ds;

(3)Define Data Adapter Object
Sy:-ObjectName=New ClassName(“Select Query”, Connection ObjectName)
Ex:-Da=new SqlDataAdapter(“Select * from EmpDetails”,Con);

(4)Define Dataset Object
Sy:-ObjectName=new ClassName();
Ex:-Ds=new Dataset();

(5)Fill the data into Dataset Using Fill( ) Method of Data Adapter
Sy:-DataAdapterObject.Fill(DatasetObject,”Temp/SourceTable Name”)
Ex:-Da.Fill(Ds,”Table1”);
Here Table Name can be Same Name as in DataBase or Different.

 Properties With Dataset Class:- 
     
SNO
Property & Options
Type
Description
01
Tables
Collection
Stores all the Relations in the Form of Collection

Methods With DataAdapter:

SNO
Property & Options
Type
Description
01
Fill(DatasetName,”Src/Temp Table Name)
int
Used to fill the given table data into the Dataset. This Method does not fill any constraints of database table into dataset

DataGridView Control:-
  1. The DataGridView control provides a powerful and flexible way to display data in a tabular format.
  2. We can use the DataGridView control to show read-only views of small amount of data/ Or we can scale it to show editable views of very large set of data.
  3. We can extend DataGridView control in a Number of ways to build custom behaviors into your applications.
  4. We can customize the appearance of the DataGridView control by choosing several properties.
  5. With DataGridView control we can display and edit tabular data from many different data sources..
  6. When we bind to a data source that contains multiple lists or tables or ,set the Data Member property to a string that specifies the list or table to bind to.
 

No comments:

Post a Comment