Help creating SQL CE Database (1 Viewer)

bbulla

I'd rather be golfing
Local time
Today, 07:28
Joined
Feb 11, 2005
Messages
101
Hello,

I am using the following code to create a new SQL CE database:

Dim engine As New SqlCeEngine("Data Source = \My Documents\test.sdf")
engine.CreateDatabase()


That code is directly from MSN, and I am pretty certain it is correct, but I keep getting an exception thrown on the 2nd line. The exception is this:

"An unhandled exception of type 'System.MissingMethodException' occured in System.Data.SqlServerCe.dll."

Can anybody help?? Using WM5 with .NET CF 1.0.

Thanks,
 

PacoAngelSantos

New member
Local time
Today, 06:28
Joined
Dec 20, 2007
Messages
1
MissingMethodException in SqlServerCE 2.0

And yes you're right, the code is correct. The thing is that you're using VS 2003 and that is not designed specifically for WM 5.0. That's why when you debug the application the cab files of SQL Server CE 2.0 are not picked up to be installed on the device. If you were using Visual Studio 2005 you woudln't have any problem, because it's designed to copy those files to the device when deploying and/or debugging.

So the solution is simple. If you're using Visual Studio 2003 you need to previously install SQL Server CE 2.0 on the device, but manually.

Check this path in your desktop computer.

C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\wce400\armv4

sql.wce4.armv4.CAB - SQL Client.
sqlce.dev.wce4.armv4.CAB - SQL CE Query Analyzer
sqlce.wce4.armv4.CAB - SQL CE


You must copy those cab files to the \Windows folder of your WM 5.0 device.

When you copy the files using the explore button of ActiveSync, you don't see the \Windows folder, so paste everything on \My Documents folder in the mean time.

Then navigate in your device and cut all the cabs from \My Documents and paste them in the \Windows folder. Then it's just matter of click each and every one to get them installed on your WM 5.0 device.

With that done, you should now be able to run that line of code without problems.

Adios,

Paco Angel Santos.

Hello,

I am using the following code to create a new SQL CE database:

Dim engine As New SqlCeEngine("Data Source = \My Documents\test.sdf")
engine.CreateDatabase()


That code is directly from MSN, and I am pretty certain it is correct, but I keep getting an exception thrown on the 2nd line. The exception is this:

"An unhandled exception of type 'System.MissingMethodException' occured in System.Data.SqlServerCe.dll."

Can anybody help?? Using WM5 with .NET CF 1.0.

Thanks,
 

capthow

New member
Local time
Today, 11:28
Joined
Mar 26, 2009
Messages
1
You can use SDF Viewer by Flyhoward Ltd to create SQL CE Version 3.1 and Version 3.5 databases
 

Users who are viewing this thread

Top Bottom