Today i will explain how to fill DataSet using C#.NET.
In the Previous articles i explained how to open form on click of the button using c#.net, how to close form on click of the button using C#.net, how to insert record into database from listview control using C#.net, how to backup and restore access database using c#.net, how to backup and restore access database using c#.net and many more about C#.Net.
Below is the Code
OleDbConnection con = new OleDbConnection("YourConnectionString");
OleDbDataAdapter da = new OleDbDataAdapter("select * from table1", con);
DataSet ds = new DataSet();
Create DataSet object.
And Fill DataSet using Fill Function. Pass DataSet object as parameter in Fill Function.
Now Next question is how to pick record from DataSet? You can use Below code :
Here we are picking title column from table which is on index no. 1.