fixitchris
Member
- Joined
- Aug 9, 2005
- Messages
- 7
DsPitem is the dataset which I manually bound at design time with the BindingSource Control.
1. instead of creating the OLEDBCONNECTION object, how can i make reference to the Connection object I created when creating datasets in Data Sources? I named it dbConn but i dont know how to use it in my code.
2. do i still need to call the SQL statement to the dataAdapter if i have datasets created in Data Sources?
The whole purpose for this project is to familiarize myself with ADO.NET.
A. Populate List Box with [item] from dsPitem dataset
B. Create Form2 on Listbox1_click event
C. Populate Listview on Form2 with records from dsRouting dataset that match the [item] field selected on form1.listbox
Any help with ADO.NET logic would be helpful.
Code:
data access using OLEDB
[B]Dim dc1 As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\chrism\Desktop\qs2.net test\db.mdb")[/B] Dim da1 As New OleDb.OleDbDataAdapter(sSQL, dc1)
Dim dr1 As DataRow
da1.Fill(DsPitem, "Pitem")
ListBox1.Items.Clear()
For Each dr1 In DsPitem.Tables("Pitem").Rows
ListBox1.Items.Add(dr1("item"))
Next
1. instead of creating the OLEDBCONNECTION object, how can i make reference to the Connection object I created when creating datasets in Data Sources? I named it dbConn but i dont know how to use it in my code.
2. do i still need to call the SQL statement to the dataAdapter if i have datasets created in Data Sources?
The whole purpose for this project is to familiarize myself with ADO.NET.
A. Populate List Box with [item] from dsPitem dataset
B. Create Form2 on Listbox1_click event
C. Populate Listview on Form2 with records from dsRouting dataset that match the [item] field selected on form1.listbox
Any help with ADO.NET logic would be helpful.