B
Burning_Ranger
I am having problems linking to the Order table (in my database). I get
an unhandled exception error in system.data.dll. The IDE points to:
daOrder.Fill(dtOrder) as the problem
My code:
Public Class fclsNewOrder
Inherits System.Windows.Forms.Form
Dim cnADONetConnection As New OleDb.OleDbConnection
Dim daCustomer As New OleDb.OleDbDataAdapter
Dim dtCustomer As New DataTable
Dim daProduct As New OleDb.OleDbDataAdapter
Dim dtProduct As New DataTable
Dim daOrder As New OleDb.OleDbDataAdapter
Dim dtOrder As New DataTable
Dim cbCommandBuilder As New OleDb.OleDbCommandBuilder
Dim intRowPos As Integer = 0
Private Sub fclsNewOrder_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
cnADONetConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\temp\turbobraze_test.mdb"
cnADONetConnection.Open()
daCustomer = New OleDb.OleDbDataAdapter("SELECT * FROM
Customer", cnADONetConnection)
daCustomer.Fill(dtCustomer)
daProduct = New OleDb.OleDbDataAdapter("SELECT * FROM Product",
cnADONetConnection)
daProduct.Fill(dtProduct)
daOrder = New OleDb.OleDbDataAdapter("SELECT * FROM Order",
cnADONetConnection)
daOrder.Fill(dtOrder)
cbCommandBuilder = New OleDb.OleDbCommandBuilder(daCustomer)
cbCommandBuilder = New OleDb.OleDbCommandBuilder(daProduct)
cbCommandBuilder = New OleDb.OleDbCommandBuilder(daOrder)
End Sub
Private Sub fclsNewOrder_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed
cnADONetConnection.Close()
End Sub
End Class
If I change the table name to Order2 or something else both in my code
and in my database it works OK, but just doesn't work as Order. There
are no other objects or entities in the database with the same name.
The other tables from the same database work fine.
an unhandled exception error in system.data.dll. The IDE points to:
daOrder.Fill(dtOrder) as the problem
My code:
Public Class fclsNewOrder
Inherits System.Windows.Forms.Form
Dim cnADONetConnection As New OleDb.OleDbConnection
Dim daCustomer As New OleDb.OleDbDataAdapter
Dim dtCustomer As New DataTable
Dim daProduct As New OleDb.OleDbDataAdapter
Dim dtProduct As New DataTable
Dim daOrder As New OleDb.OleDbDataAdapter
Dim dtOrder As New DataTable
Dim cbCommandBuilder As New OleDb.OleDbCommandBuilder
Dim intRowPos As Integer = 0
Private Sub fclsNewOrder_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
cnADONetConnection.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\temp\turbobraze_test.mdb"
cnADONetConnection.Open()
daCustomer = New OleDb.OleDbDataAdapter("SELECT * FROM
Customer", cnADONetConnection)
daCustomer.Fill(dtCustomer)
daProduct = New OleDb.OleDbDataAdapter("SELECT * FROM Product",
cnADONetConnection)
daProduct.Fill(dtProduct)
daOrder = New OleDb.OleDbDataAdapter("SELECT * FROM Order",
cnADONetConnection)
daOrder.Fill(dtOrder)
cbCommandBuilder = New OleDb.OleDbCommandBuilder(daCustomer)
cbCommandBuilder = New OleDb.OleDbCommandBuilder(daProduct)
cbCommandBuilder = New OleDb.OleDbCommandBuilder(daOrder)
End Sub
Private Sub fclsNewOrder_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed
cnADONetConnection.Close()
End Sub
End Class
If I change the table name to Order2 or something else both in my code
and in my database it works OK, but just doesn't work as Order. There
are no other objects or entities in the database with the same name.
The other tables from the same database work fine.