Hello,
I am trying to connect to my database and am using the following code
when i run the code nothing appears to happen, I can't see where I have gone wrong.
can anyone spot anything glaringly obvious??
Thanks for your time
I am trying to connect to my database and am using the following code
Code:
Imports System.Data
Public Class Form1
Dim con As New OleDb.OleDbConnection
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
Dim MaxRows As Integer
Dim inc As Integer = -1
Private Sub TabPage2_Click(sender As System.Object, e As System.EventArgs) Handles TabPage2.Click
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Unit2.MDB"
sql = "Select * From SRuser Where stage = Test"
con.Open()
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "User")
con.Close()
cbTestEmp.DataSource = ds.Tables("User")
cbTestEmp.DisplayMember = ("Uname")
End Sub
can anyone spot anything glaringly obvious??
Thanks for your time