M
Mr. B
Over a year ago, I did my first VB.net application with an Access db. Because
at that time, I was not familar with how to manipulate DB's, I used the drag
on Icons under 'DATA' in the Toolbox to do my Connections, Data Adapters and
DataSets.
Now I want to do the actual Code for them as I want to better understand and
control them, etc. I have started to attack my application with this in mind.
And I'm making some success. But I've hit a wall on an issue (and hopefully
it will be my only one).
I had the following Icon names:
Connection: OleDbConnection1
Data Adapter: daTSUpdate
Dataset: dsTSUpdate
My Code so far is thus (watch out for word wrapping):
' Connection String to OmiTSMaster.mdb
Dim FullDataPath As String = mdbDataPath & "\ExtraServicesData.mdb"
Dim connString2 As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=FullDataPath"
Dim OleDbConnection1 As OleDbConnection = New OleDbConnection
OleDbConnection1.ConnectionString = connString1
' Data Adapter 1
Dim daTSUpdate As OleDbDataAdapter = New OleDbDataAdapter("SELECT Amount,
Category, Chargeout_Level, Class, Cost_Code, Description, Description1,
Description2, Employee, Employee_Name, Employee1, Group_Cost_Code, ID, Job,
Pay_ID, Pay_ID1, Pay_Type", OleDbConnection1)
' New Dataset 1
Dim DsTSUpdate As DataSet = New DataSet
Now... when I came to Fill my Dataset, originally I had the following Code:
' Fill Dataset
daTSUpdate.Fill(DsTSUpdate, "TSUpdate")
But that gave me an error... so I figured this out (at least it didn't give me
an error):
' Fill Dataset
daTSUpdate.Fill(DsTSUpdate.Tables("TSUpdate"))
But later on in my Code, I have several more errors (which are similar as the
following line):
Dim dtProject As DataTable = dsTSUpdate.TSUpdate
The Error always is the "dsTSUpdate.TSUpdate" part. I can't figure out how to
fix this. I've tried several ideas, but they all show an error. But it
worked just fine when I used the Toolbox Icons to create all the connections,
etc. (scratching my head on this).
Anyone know what I need to do? Much appreciated!
Regards,
Bruce F
at that time, I was not familar with how to manipulate DB's, I used the drag
on Icons under 'DATA' in the Toolbox to do my Connections, Data Adapters and
DataSets.
Now I want to do the actual Code for them as I want to better understand and
control them, etc. I have started to attack my application with this in mind.
And I'm making some success. But I've hit a wall on an issue (and hopefully
it will be my only one).
I had the following Icon names:
Connection: OleDbConnection1
Data Adapter: daTSUpdate
Dataset: dsTSUpdate
My Code so far is thus (watch out for word wrapping):
' Connection String to OmiTSMaster.mdb
Dim FullDataPath As String = mdbDataPath & "\ExtraServicesData.mdb"
Dim connString2 As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=FullDataPath"
Dim OleDbConnection1 As OleDbConnection = New OleDbConnection
OleDbConnection1.ConnectionString = connString1
' Data Adapter 1
Dim daTSUpdate As OleDbDataAdapter = New OleDbDataAdapter("SELECT Amount,
Category, Chargeout_Level, Class, Cost_Code, Description, Description1,
Description2, Employee, Employee_Name, Employee1, Group_Cost_Code, ID, Job,
Pay_ID, Pay_ID1, Pay_Type", OleDbConnection1)
' New Dataset 1
Dim DsTSUpdate As DataSet = New DataSet
Now... when I came to Fill my Dataset, originally I had the following Code:
' Fill Dataset
daTSUpdate.Fill(DsTSUpdate, "TSUpdate")
But that gave me an error... so I figured this out (at least it didn't give me
an error):
' Fill Dataset
daTSUpdate.Fill(DsTSUpdate.Tables("TSUpdate"))
But later on in my Code, I have several more errors (which are similar as the
following line):
Dim dtProject As DataTable = dsTSUpdate.TSUpdate
The Error always is the "dsTSUpdate.TSUpdate" part. I can't figure out how to
fix this. I've tried several ideas, but they all show an error. But it
worked just fine when I used the Toolbox Icons to create all the connections,
etc. (scratching my head on this).
Anyone know what I need to do? Much appreciated!
Regards,
Bruce F