Yes, I applied Andy's reply, and it works, BUT, it only inserts upto 7 records out of my 54 records. Why? @Andy , do you have any idea?
Dim dt As DataTable Dim sc As SQLiteCommand Dim Script As String = Nothing Dim Script2 As String = Nothing Dim Script3 As String = Nothing Script = "insert into paperdate(dtime,papernum,paperstat,user) select " & "'" & dt.Rows(0)(0) & "'" & " as " & "dtime" & "," & dt.Rows(0)(1) & " as " & "papernum" & "," & "'" & dt.Rows(0)(2) & "'" & " as " & "paperstat" & "," & "'" & dt.Rows(0)(3) & "'" & " as " & "user" For i As Integer = 1 To dt.Rows.Count - 1 Script2 = " union select " & "'" & dt.Rows(i)(0) & "'" & "," & dt.Rows(i)(1) & "," & "'" & dt.Rows(i)(2) & "'" & "," & "'" & dt.Rows(i)(3) & "'" Script3 = Script3 & Script2 Next sc = New SQLiteCommand(Script & Script3, mycon) sc.ExecuteNonQuery() sc.Dispose()
I'm sure the loop is fine and data is there, but, really inserts upIt's true using sqlite to 7 records only. Mayinsert multiple rows at a + will do if answers are greatly appreciated?time is very possible. By Andy wrote.
thanks Andy +1