Asked By ing. ignazio pinto
06-Nov-09 07:28 AM
Hi, to all
I have this question for you:
it is possible to use BULK INSERT T-SQL Statement with SQL Server Compact
Edition?
I try as follow:
Private Sub DatToTableCE(ByVal conStr As String, ByVal dbTable As String,
ByVal dat As String, ByVal xml As String)
Try
Dim query As New StringBuilder
query .Append("BULK INSERT ")
query .Append(dbTable)
query .Append(" FROM '" & dat & "'")
query .Append(" WITH (FORMATFILE = '" & xml & "')")
Dim conn As New SqlCeConnection(conStr)
conn.Open()
Using cmd As New SqlCeCommand()
cmd.Connection = conn
cmd.CommandText = query .ToString
cmd.ExecuteNonQuery()
End Using
Catch sqlExc As SqlCeException
MsgBox(sqlExc.toString)
End Try
End Sub
but this code return me a sqlCeException.
Have you any suggests?
Thank you
--