M
Merlin
Hello All,
Hope somebody wouldn`t mind helping me, i have a problem and as a newbie I
don`t know where im going wrong:
I keep getting the following error "An unhandled exception of type
'System.Data.OleDb.OleDbException' occurred in system.data.dll" on the line
that says: "daPatientsIDs.Fill(dtPatientsIDs)"
When trying to run this Code:
'CODE START
Option Strict On
Imports System.Data.OleDb
Public Class Form1
Inherits System.Windows.Forms.Form
Dim dbConnection As OleDbConnection
Dim dbCommand As OleDbCommand
Dim dbDataAdapter As OleDbDataAdapter
Dim ConnectString As String = "Provider = Microsoft.Jet.OLEDB.4.0;" &
"Data Source = Hospital.MDB"
Dim dtPatientsIDs As New DataTable()
Dim daPatientsIDs As New OleDbDataAdapter("Select [Patients ID] from
Patients", ConnectString)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
daPatientsIDs.Fill(dtPatientsIDs)
lstPatientIDs.DataSource = dtPatientsIDs
lstPatientIDs.DisplayMember = "Patient ID"
OleDbDataAdapter.Fill(dsPatientsAndWards)
txtWardName.DataBindings.Add("Text", dsPatientsAndWards, "Patients.Ward
Name")
txtWardType.DataBindings.Add("Text", dsPatientsAndWards, "Patients.Ward
Type")
End Sub
End Class
'CODE FINISH
Anybody shed any light on this?
Regards
Merlin
Hope somebody wouldn`t mind helping me, i have a problem and as a newbie I
don`t know where im going wrong:
I keep getting the following error "An unhandled exception of type
'System.Data.OleDb.OleDbException' occurred in system.data.dll" on the line
that says: "daPatientsIDs.Fill(dtPatientsIDs)"
When trying to run this Code:
'CODE START
Option Strict On
Imports System.Data.OleDb
Public Class Form1
Inherits System.Windows.Forms.Form
Dim dbConnection As OleDbConnection
Dim dbCommand As OleDbCommand
Dim dbDataAdapter As OleDbDataAdapter
Dim ConnectString As String = "Provider = Microsoft.Jet.OLEDB.4.0;" &
"Data Source = Hospital.MDB"
Dim dtPatientsIDs As New DataTable()
Dim daPatientsIDs As New OleDbDataAdapter("Select [Patients ID] from
Patients", ConnectString)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
daPatientsIDs.Fill(dtPatientsIDs)
lstPatientIDs.DataSource = dtPatientsIDs
lstPatientIDs.DisplayMember = "Patient ID"
OleDbDataAdapter.Fill(dsPatientsAndWards)
txtWardName.DataBindings.Add("Text", dsPatientsAndWards, "Patients.Ward
Name")
txtWardType.DataBindings.Add("Text", dsPatientsAndWards, "Patients.Ward
Type")
End Sub
End Class
'CODE FINISH
Anybody shed any light on this?
Regards
Merlin