How to create typeDataset and use it programtically

1. Add a Dataset in the project.
2. Create table and Column in the dataSet.
for Example
MyDataset   //Name of Dataset
MyTable     //Name of Table
Name       //Field
Code        //Field
Contact    //Field
3.How add a value in a table and display in grid.

private void LoadDataGrid()


MyDataset myDataSet=

new MyDataset();

MyDataset.MyTableDataTable myDataTable =myDataSet.MyTable ;

MyDataset.MyTableRow myDataRow=myDataSet.MyTable.NewMyTableRow ();





dataGrid1.DataSource=myDataSet.MyTable ;


4. How to retrive the value

string name=myDataSet.MyTable[0].Name.ToString();


string name=myDataSet.MyTable[0][0].ToString();




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s