G
Guest
Hi,
I'm trying to import data from csv file into a sql table. this is how i read
the information from the file:
=============
Private Sub import_oledb()
da_import.Fill(Ds_import_u)
Dim strPath As String = "c:\test.csv"
Dim ds As New DataSet
Try
Dim f As System.IO.File
If f.Exists(strPath) Then
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"c:\" & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim da As New OleDb.OleDbDataAdapter("Select * from " & _
"test.csv", conn)
da.Fill(ds, "test.csv")
End If
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
DataGrid1.DataSource = ds.Tables(0)
End Sub
=============================
Now, this fills the ds and binds the datagrid. how do i dump all these rows
in a table in sql database?
I would appreciate any help.
Thank you,
Catalin
I'm trying to import data from csv file into a sql table. this is how i read
the information from the file:
=============
Private Sub import_oledb()
da_import.Fill(Ds_import_u)
Dim strPath As String = "c:\test.csv"
Dim ds As New DataSet
Try
Dim f As System.IO.File
If f.Exists(strPath) Then
Dim ConStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"c:\" & ";Extended Properties=""Text;HDR=No;FMT=Delimited\"""
Dim conn As New OleDb.OleDbConnection(ConStr)
Dim da As New OleDb.OleDbDataAdapter("Select * from " & _
"test.csv", conn)
da.Fill(ds, "test.csv")
End If
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
DataGrid1.DataSource = ds.Tables(0)
End Sub
=============================
Now, this fills the ds and binds the datagrid. how do i dump all these rows
in a table in sql database?
I would appreciate any help.
Thank you,
Catalin