How to fill dataset using C#.Net - Starter C#.Net Tutorials.



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#.nethow to close form on click of the button using C#.nethow to insert record into database from listview control using C#.nethow to backup and restore access database using, how to backup and restore access database using 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.

Give your Valuable Comments.
comments powered by Disqus
Follow me on twitter
About Me
Harpreet Singh
I began programming with C++ when i was 17. Then at the middle of my study .NET came. Then I began to read C# and VB.NET. By the time i learnt SQL and ASP.NET, and developed some websites such as news portals that are active now. Currently i am running my own Software company.
More Articles