R
Rnt6872
I need to import a .csv file into a firebird database. I am able to
cnnect tothe databe using:
Dim ds1 As New DataSet
Dim SQLString As String = "insert into rdstype27
(division,trans_code,DATE,TIME,dept,vend,emp_no,online_function,sku_del_units,
sku_handling_class, sku_no, loc, qty, retail,dc_sort_code,dc)
values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
Dim constringa As String =
"User=DBADMIN;Password=admin;Database=E:\Firebird
\RDS.FDB;DataSource=fs000xveuc90;Port=3050;Dialect=3;Charset=NONE;Role=user;Connection
lifetime=0;Connection timeout=15;Pooling=True;Packet Size=8192;Server
Type=0"
Dim FBcn As New
FirebirdSql.Data.FirebirdClient.FbConnection(constringa)
Dim da As New
FirebirdSql.Data.FirebirdClient.FbDataAdapter(SQLString, FBcn)
Dim cmdBuilder As
FirebirdSql.Data.FirebirdClient.FbCommandBuilder = New
FirebirdSql.Data.FirebirdClient.FbCommandBuilder(da)
Dim dtRecords1 As New DataTable
Dim InsertCmd As FirebirdSql.Data.FirebirdClient.FbCommand =
New FirebirdSql.Data.FirebirdClient.FbCommand
FBcn.Open()
Then I can parse the file using:
Using parser As New FileIO.TextFieldParser("e:\firebird
\actblrds027rl.txt")
parser.SetDelimiters(",")
Try
While Not parser.EndOfData
Me.DataGridView1.Rows.Add(parser.ReadFields())
End While
Beep()
MsgBox("Import Successfull!!")
Catch ex As Exception
MsgBox(e.ToString)
End Try
End Using
I need to get the data that is in the datagridview into the database.
Please help
cnnect tothe databe using:
Dim ds1 As New DataSet
Dim SQLString As String = "insert into rdstype27
(division,trans_code,DATE,TIME,dept,vend,emp_no,online_function,sku_del_units,
sku_handling_class, sku_no, loc, qty, retail,dc_sort_code,dc)
values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
Dim constringa As String =
"User=DBADMIN;Password=admin;Database=E:\Firebird
\RDS.FDB;DataSource=fs000xveuc90;Port=3050;Dialect=3;Charset=NONE;Role=user;Connection
lifetime=0;Connection timeout=15;Pooling=True;Packet Size=8192;Server
Type=0"
Dim FBcn As New
FirebirdSql.Data.FirebirdClient.FbConnection(constringa)
Dim da As New
FirebirdSql.Data.FirebirdClient.FbDataAdapter(SQLString, FBcn)
Dim cmdBuilder As
FirebirdSql.Data.FirebirdClient.FbCommandBuilder = New
FirebirdSql.Data.FirebirdClient.FbCommandBuilder(da)
Dim dtRecords1 As New DataTable
Dim InsertCmd As FirebirdSql.Data.FirebirdClient.FbCommand =
New FirebirdSql.Data.FirebirdClient.FbCommand
FBcn.Open()
Then I can parse the file using:
Using parser As New FileIO.TextFieldParser("e:\firebird
\actblrds027rl.txt")
parser.SetDelimiters(",")
Try
While Not parser.EndOfData
Me.DataGridView1.Rows.Add(parser.ReadFields())
End While
Beep()
MsgBox("Import Successfull!!")
Catch ex As Exception
MsgBox(e.ToString)
End Try
End Using
I need to get the data that is in the datagridview into the database.
Please help