SQL Server - Bulk Insert and SQL CE?

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
--
SQL Server
(1)
DatToTableCE
(1)
SqlCeResultSetas
(1)
SqlCeResultSet
(1)
SqlCeCommand
(1)
StringBuilder
(1)
Ejlskov
(1)
DbTable
(1)
  ErikEJ replied to ing. ignazio pinto
13-Nov-09 04:45 AM
The fastest way to insert data via managed code is to use the SqlCeResultSet
as show here:
http://windowsmobiledn.com/sql-compact-edition-insert-performance/
and in the source of this project: http://sqlcebulkcopy.codeplex.com
--
Erik Ejlskov Jensen - MCTS: Mobile App Dev
help
server SQL Server Do I have to set up a sql server database on a sql server? Or can I do this on any server SQL Server Setup Discussions SQL Server (1) CREATE DATABASE (1) Databases (1) Database (1) Create
Install SQL Server SQL Server Hi, how can I start the SQL Server 2008 Express setup and (1.) define the name of the SQL Server and (2.) that the authentication is Windows and SQL-server? Christian SQL Server Setup Discussions
strawberry perl and sql server SQL Server I need to connect to sql server from strawberry perl. Is anyone aware of any free driver for this. thanks. SQL Server Discussions SQL Server 2005 (1) SQL Server 2000 (1) SQL Express (1) SQL Server (1
MSDE on Windows 2003 R2 box, new DL385G6 - Install Fails during SQL Services SQL Server I have been finding that I am having trouble with the Crystal Reports Server XI installation failing when it is dealing with SQL. So, as a thought and in case there was something wrong with my SQL portion of the isntall. I thought ok, I will try installing the actual MSDE application direct from Microsoft. So, I downloaded the MSDE for SQL 2000 (which is msde2000a.exe), set my switches and off to the races. It quit seconds left to the installation and bombed with the same errors as the Crystal Reports Server install. The error is the same whether I try to install MSDE by itself or