even if this thread is already 11 years ago... I just want to say **** you guys this thread is ****ing no help at all...
this is the sample of the codes for this ****ing topic you can suggest and edit the codes if you want...
Function fastImport()
ExecuteQuery("DELETE from tbl_item")
'dt = ExecuteQuery("Select * from tbl_items")
Try
Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = "SELECT * FROM tbl_item"
cmd.ExecuteNonQuery()
' For optimal performance use base table access
'
cmd.CommandText = "tbl_item"
cmd.CommandType = CommandType.TableDirect
Dim rs As SqlCeResultSet = cmd.ExecuteResultSet(ResultSetOptions.Updatable Or ResultSetOptions.Scrollable)
Dim rec As SqlCeUpdatableRecord = rs.CreateRecord()
Dim x As Integer
x = 0
Cursor.Current = Cursors.WaitCursor
Dim d As Integer
Dim p As Integer = 0
Dim a As String
Dim b() As String
Dim sr As New System.IO.StreamReader(directory1.ToString & "\ITEM.TXT")
a = sr.ReadLine
d = 0
Do Until a Is Nothing
If Len(a) = 0 Then
sr.Close()
File.Delete(directory.ToString & "\ITEM.TXT")
Exit Do
End If
x = x + 1
b = a.Split(",")
a = sr.ReadLine
If x = 1 Then
Continue Do 'line is the header
End If
'dcs,upc_alu,brand,desc1_style_modelname,desc2_style_article,attr,size,cost,price,qty
'Trim(b(0).Replace("'", "")) & "','" & Trim(b(1).Replace("'", "")) & "','" & Trim(b(2).Replace("'", "")) & "','" & Trim(b(3).Replace("'", "")) & "','" & Trim(b(4).Replace("'", "")) & "','" & Trim(b(5).Replace("'", "")) & "','" & Trim(b(6).Replace("'", "")) & "','" & Trim(b(7).Replace("'", "")) & "','" & Trim(b(8).Replace("'", "")) & "','" & Trim(b(9).Replace("'", ""))
rec.SetString(1, Trim(b(0).Replace("'", "")))
rec.SetString(2, Trim(b(1).Replace("'", "")))
rec.SetString(3, Trim(b(2).Replace("'", "")))
rec.SetString(4, Trim(b(3).Replace("'", "")))
rec.SetString(5, Trim(b(4).Replace("'", "")))
rec.SetString(6, Trim(b(5).Replace("'", "")))
rec.SetString(7, Trim(b(6).Replace("'", "")))
rec.SetSqlMoney(8, Trim(b(7).Replace("'", "")))
rec.SetSqlMoney(9, Trim(b(8).Replace("'", "")))
rec.SetSqlMoney(10, Trim(b(9).Replace("'", "")))
rs.Insert(rec)
d = d + 1
Loop
cmd.Dispose()
conn.Close()
getall()
Cursor.Current = Cursors.Default
MsgBox("Data successfully imported", MsgBoxStyle.Information, "")
Catch e As Exception
MessageBox.Show(e.Message)
End Try
Return Nothing
End Function