M
Mark
Hello all -
I'm really banging my ahead on this one and pulling my
hair out as the functionality is simple to do but for
some reason, I can't get my code to work. What I'm
attempting to do is pull data in from a text file into a
dataset and then take that dataset and update the
database through a separate dataadapter that is linked to
the db. My code is below. Any suggestions on things
that could be out of place are appreciated.
Much thanks,
Mark
Dim sConnectionString As String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:/Test;Extended Properties=Text;"
Dim objConn As New System.Data.OleDb.OleDbConnection
(sConnectionString)
objConn.Open()
Dim da As System.Data.OleDb.OleDbDataAdapter = New
OleDbDataAdapter("Select * from OPIROUT.TXT", objConn)
Dim sqlCommandBuilder As OleDb.OleDbCommandBuilder = New
OleDb.OleDbCommandBuilder(da)
da.FillSchema(dsDailyIR, SchemaType.Mapped)
da.Fill(dsDailyIR)
'da.Update(dsDailyIR) <------ this is NOT the database
data adapter.
cnSQL.Open()
daDailyIR.Fill(dsDailyIR)
'daDailyIR.Update(dsDailyIR) <----- Do I need to update
here??
cnSQL.Close()
I'm really banging my ahead on this one and pulling my
hair out as the functionality is simple to do but for
some reason, I can't get my code to work. What I'm
attempting to do is pull data in from a text file into a
dataset and then take that dataset and update the
database through a separate dataadapter that is linked to
the db. My code is below. Any suggestions on things
that could be out of place are appreciated.
Much thanks,
Mark
Dim sConnectionString As String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:/Test;Extended Properties=Text;"
Dim objConn As New System.Data.OleDb.OleDbConnection
(sConnectionString)
objConn.Open()
Dim da As System.Data.OleDb.OleDbDataAdapter = New
OleDbDataAdapter("Select * from OPIROUT.TXT", objConn)
Dim sqlCommandBuilder As OleDb.OleDbCommandBuilder = New
OleDb.OleDbCommandBuilder(da)
da.FillSchema(dsDailyIR, SchemaType.Mapped)
da.Fill(dsDailyIR)
'da.Update(dsDailyIR) <------ this is NOT the database
data adapter.
cnSQL.Open()
daDailyIR.Fill(dsDailyIR)
'daDailyIR.Update(dsDailyIR) <----- Do I need to update
here??
cnSQL.Close()