Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: AccessVB.NET
how can i Connect to data base Access And Set DataSet (Without Wizard) By Writing Code ?
 
Example: I can connect Data base By This Code :
 
 Dim da As New OleDb.OleDbDataAdapter
    Dim ds As New DataSet
    Dim con As OleDb.OleDbConnection
    Dim con_str As String = "provider=microsoft.jet.oledb.4.0;data source=e:\damyar.mdb;"
 
 con.ConnectionString = con_str
        con.Open()
 
Now i Have a DataGridView , i want Fill Dataset(DS) by (CON) Connection And Table (Table1) , Then Fill Datagrid by (DS)
 
NOTE : Dont Use Wizard , Just Writing Code
Posted 13-Nov-11 20:19pm
synctor391
Comments
thatraja at 14-Nov-11 2:48am
   
NOTE : Dont Use Wizard , Just Writing Code :Confused:, Whose command this?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This looks suspiciously like homework, so no code!
 
1) Create an SQL SELECT statement: "SELECT * FROM MyTable" will do, where MyTable is the name of the table to want to access.
2) Create an OleDbDataAdapter, and use the select statement and your connection to create a new instance.
3) Create a DataSet object, and assign a new instance to it.
4) Fill the DataSet from the OleDbDataAdapter (HINT: use the Fill method)
5) Set the DataGridView DataSource property to the first table in the DataSet.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

HI HOW DID CREATE DATASET IN VB.NET CODEING & FORMS
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 375
1 Abhinav S 333
2 OriginalGriff 330
3 sanket saxena 305
4 CPallini 175
0 Sergey Alexandrovich Kryukov 8,497
1 OriginalGriff 4,850
2 Peter Leow 3,839
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid