Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

adding sql server compact in platform builder wince5.0

61 views
Skip to first unread message

jwei

unread,
Nov 19, 2009, 4:19:01 AM11/19/09
to
i would use sql server compact in .net (c#)

what i have to add from catalog ?
- SQL Compact
- SQL Mobile
- SQL Server CE 2.0

i tried on a device to create a db via SqlCeEngine.CreateDatabase on sotrage
card
but i get error:
"SQL Mobile encountered problems when creating the database"
HResult : -2147024882
NativeError : 28558

there is enough space on storage card ....

Paul G. Tobey [ eMVP ]

unread,
Nov 20, 2009, 10:12:04 AM11/20/09
to
You add what you want to use. SQL Compact is the most-recent of those. I
don't usually build the database into the OS, myself. I feel like I'd rather
install it to a completed device.

As for the error, convert that HResult value to a hex number and use the
Error Lookup tool to see what it's telling you.

Paul T.

jwei

unread,
Nov 20, 2009, 1:14:01 PM11/20/09
to
but i have to build either with

- SQL Compact
- SQL Server CE 2.0

or

- SQL Mobile
- SQL Server CE 2.0

for the result google says is a 'not enough memory' error but i try to
create the database on a 4gb storage card .?!?

Paul G. Tobey [eMVP]

unread,
Nov 26, 2009, 11:31:06 AM11/26/09
to
Why? Why would you need to have two database systems in the OS? Just put
SQL Compact 3.5 in and use it.

Paul T.

"jwei" <jw...@discussions.microsoft.com> wrote in message
news:AE5BA658-F059-4AEB...@microsoft.com...

jwei

unread,
Nov 27, 2009, 4:16:01 PM11/27/09
to

no i only want one working database

within platform builder 5 i can choose from these modules:

SQL Compact, SQL Mobile, SQL Server CE 2.0

i choosen SQL Compact and SQL Server CE 2.0 (i think that SQL Compact is
only the provider for .net and SQL Server CE 2.0 is the real server ?)

but i get error as described (sqlengine.createdatabase):

"SQL Mobile encountered problems when creating the database"
HResult : -2147024882
NativeError : 28558

so should i install SQL Server Compact 3.5 for platformbuilder 5 ?

i am using .net cf v2.0 .

> .
>

Paul G. Tobey [eMVP]

unread,
Nov 27, 2009, 7:27:50 PM11/27/09
to
No, you're completely wrong and that's why I asked. The server has just the
server in it. If you want the managed code interface, that's in a different
part of the catalog (under .NET CF, if I remember correctly, but check for
sub-items of SQL Compact, too).

SQL Compact, SQL Mobile, and SQL Server CE 2.0 are all three different
versions of the same database engine. Pick one.

Paul T.

"jwei" <jw...@discussions.microsoft.com> wrote in message

news:C7D62745-D0EA-4B87...@microsoft.com...

jwei

unread,
Nov 30, 2009, 10:13:01 AM11/30/09
to
ok now i used SQL Compact and it seems to work
but sometime it doesnt work - maybe a low memory problem ? (unfortunately
the exception message is empty ...)
and how can i pre-load the needed dll's for the sql server in c# ? (pinvoke
for LoadLibrary ?)

> .
>

jwei

unread,
Nov 30, 2009, 10:20:03 AM11/30/09
to
which dll's i have to preload for compact server ce ?
i use

[DllImport("coredll.dll", EntryPoint = "LoadLibrary", SetLastError = true)]
public static extern IntPtr LoadLibrary(string lpszLib);

> .
>

jwei

unread,
Nov 30, 2009, 11:41:02 AM11/30/09
to
another problem is, that visual studio (2008) always installs cab's' for
sqlce30 when i deploy the first time after reboot

i thinked the server is in the platform builder image ? ...

> .
>

Paul G. Tobey [eMVP]

unread,
Nov 30, 2009, 11:05:30 PM11/30/09
to
None. If you are trying to P/Invoke and are not just throwing that term out
there without understanding what it means, you're doing the wrong thing.
Use the managed code interface for SQL Server Compact. No LoadLibrary, no
DllImport...

Paul T.

"jwei" <jw...@discussions.microsoft.com> wrote in message

news:94FAD9AF-8EB6-4301...@microsoft.com...

Paul G. Tobey [eMVP]

unread,
Nov 30, 2009, 11:07:30 PM11/30/09
to
Then I'd say that you are misreferencing SQL CE 3.0. Install the SQL Server
Compact 3.5 Service Pack (whatever), on your desktop machine and reference
that. It's installing 3.0 because that's what your project says it uses and
it doesn't find that version on the device. There's also a project setting
not to deploy SQL CE, which will just cause your program to try to use
whatever is present.

Paul T.

"jwei" <jw...@discussions.microsoft.com> wrote in message

news:2451149D-CBAA-4B0A...@microsoft.com...

jwei

unread,
Dec 2, 2009, 2:32:01 PM12/2/09
to
the problem is, that the first db-access takes longer than subsequent db-calls
so i tried to pre-load the needed dll's for sql compact server ...

> .
>

jwei

unread,
Dec 2, 2009, 2:37:01 PM12/2/09
to
yes i think thats right : in visual studio 2008 the dll version is 3.0 (i
only have this version installed ...)

so for my understanding : if i select compact sql in platform builder 5 and
i reference sql ce version 2 in visual studio (maybe 2005?) i dont have to
install the cab's separately (should than also work with Server Compact 3.5
Service Pack for pb5) ?

where i can find the project setting for not deploying SQL CE ?

> .
>

Paul G. Tobey [eMVP]

unread,
Dec 2, 2009, 9:51:49 PM12/2/09
to
And it didn't work. The time has nothing to do with load time which, unless
you are loading the DLLs from a floppy disk or something, is essentially
zero. What operation are you performing?

Paul T.

"jwei" <jw...@discussions.microsoft.com> wrote in message

news:98724FE4-EE40-4DA6...@microsoft.com...

Paul G. Tobey [eMVP]

unread,
Dec 2, 2009, 9:52:59 PM12/2/09
to
Why are you trying to do everything the hardest way possible? Install the
version of SQL CE 3.5 for the PC (see www.microsoft.com/downloads).
Reference the correct version of SQLCE.

Paul T.

"jwei" <jw...@discussions.microsoft.com> wrote in message

news:BA914275-0073-49BF...@microsoft.com...

jwei

unread,
Dec 3, 2009, 2:39:01 AM12/3/09
to
i already have SQL CE 3.5 for pc - but i cant find the update for PB5

i have installed PB5 with all monthly updates (cumulative including update
rollup 12/31/2008)

where can i download the update (SQL CE 3.5) for PB5 ???

> .
>

jwei

unread,
Dec 3, 2009, 2:51:01 AM12/3/09
to
ok found out that PB5 alread has 3.5 installed (eg
C:\WINCE500\OTHERS\SQLCOMPACT\ARMV4I\sqlcecompact35.dll ...)

so i will reference the correct version in vs2008 ;)

jwei

unread,
Dec 3, 2009, 3:41:01 AM12/3/09
to

next problem:

if i run the application via autostart the database works fine (create
sample db in application)

if i run from within vs2008 everytime the cabs for ce (eg
sqlce.wce5.armv4i.CAB) gets installed - why ??? and how can i turn off ?

but i use sql ce 3.5 sp1 on pc and also sql ce 3.5 sp1

jwei

unread,
Dec 3, 2009, 4:23:02 AM12/3/09
to
found it out : was a version mismatch:

[3.5.5692.0]
GAC_System.Data.SqlServerCe_v3_5_1_0_cneutral_1.dll

[3.5.5386.0]
\Microsoft SQL Server Compact Edition\v3.5\Devices\System.Data.SqlServerCe.dll


so i installed latest ce sp1 for device and now the cabs doesnt get installed

0 new messages