Hi all I am creating an app that utilises and MS Access back end and queries it quite a bit at various times.
What I would like to do is bring in an entire table and then query the row(s) i want as I need them.
This is what I have so far:
Dim con As New OleDb.OleDbConnection con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\TenderSearch\eTenderBox\eTenderBox\Databases\eTenderBox.mdb" con.Open() Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String inc = -1 'Here we search the SUPPLIER TABLE for an email address that matches that privided in the supplier login text box. sql = "SELECT * FROM tblSuppliers" da = New OleDb.OleDbDataAdapter(sql, con) 'Here we place all data returned from our table into a dataset call SUPPLIERINFO 'All comparisons and changes are actually made to this data set and then saved to the table when finished. da.Fill(ds, "SupplierInfo") con.Close() Dim supplierlogin As String Dim supplierpassword As String Dim suppliername As String Dim maxrows As Integer maxrows = ds.Tables("SupplierInfo").Rows.Count supplierlogin = ds.Tables("SupplierInfo").Rows(0).Item("Email") supplierpassword = ds.Tables("SupplierInfo").Rows(0).Item("fldPW") suppliername = ds.Tables("SupplierInfo").Rows(0).Item("Firstname") sSupplierID = ds.Tables("Supplierinfo").Rows(0).Item("SupplierID")
Rather than having to run SQL queries all the time, I was hoping to load everything into a datatable and simply query that as needed.
Can anyone assist how to set up the DataTable and then query it.
OR any suggestions for a better alternative would be gladly accepted.