Hi
i think it is late for u. but even, there is a solution for ur question. ofcourse i think it may help u.
Dim ds As New DataSet
' Pull connection string from Web.Config (will be encrypted later)
Dim objConn As New System.Data.OleDb.OleDbConnection( _
System.Configuration.ConfigurationManager.Connecti onStrings _
("MyConnectionString").ToString)
'WHY DOES THIS SITE CHOP APART "ConnectionStrings" ABOVE???
' THERE SHOULD NOT BE A SPACE THERE!! I PUT NONE THERE!
' Make sure the .CSV file exists:
If File.Exists(strPath & strFileName) Then
Try
' ------ Load the data from the .CSV file: ----------
' NOTE: "Source' is text user enters that gets put into db
' Grab "Source" text from ASP.NET textbox:
Dim strSource As String = Me.txtSource.Text
Dim strSQL As String = "INSERT INTO [tblDoNotCallList] " & _
"(AreaCode, PhoneNumber,Source, DateTimeAdded)" & _
"SELECT F1, F2,'" & strSource & "', Now() AS DateTimeStamp" & _
" FROM [Text;HDR=NO;DATABASE=C:\Documents and" & _
"Settings\...\Website;].[importFile.csv]"
objConn.Open()
Dim objCommand As New System.Data.OleDb.OleDbCommand(strSQL, objConn)
objCommand.CommandText = strSQL
objCommand.ExecuteNonQuery()
objConn.Close()
Catch ex as Exception
'handle error here
End Try
and another one is in
vb i am giving u the link
http://www.vb-helper.com/howto_ado_load_csv.html