How to use dataset to contain the data from access databsase

Home Forums General Programming C# How to use dataset to contain the data from access databsase

This topic contains 0 replies, has 1 voice, and was last updated by  Hirendra Sisodiya 6 years, 1 month ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #3104

    The following code sample shows that how we can use create dataset or datatable from Access database:

    DataSet ds=new DataSet();
    OleDbConnection con; // create connection
    OleDbCommand com; // create command
    con = new OleDbConnection(“Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\\Program Files (x86)\\ParamSave.mdb”);
    com = new OleDbCommand(“Select * from tblcatagory”, con);
    con.Open(); // open the coinnection
    OleDbDataAdapter oadap=new OleDbDataAdapter(com);
    oadap.Fill(ds);
    con.Close();

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.