PulsingTempleVein
2010-03-21 18:24:01 UTC
I am failing miserably at getting SQL compact to work on my new headless
hardware.
CE 6.0 R3, Updates to Dec 2009 Rollup
Hardware is a Headless x86 device (iCop VDX-6315)
Included in the OS image that I am building:
SQL Compact
SQL Compact Managed Provider
.NET Compact Framework 3.5 Headless
.NET Compact Framework String Resources - Headless
OS Dependencies for .NET Compact Framework 3.5 - Headless
Using Hive based registry
I have an application (using SQL ce) that I have been running on an x86
system with a display for two years, I hit this problem when I first tried to
run it on the headless device. To simplify things I made a test application
(VS2008) which is basically the Microsoft example using the northwind
database.
I do not get the dreaded PInvoke error but I get this on connection.Open():
System.Data.SqlServerCe.SqlCeException was unhandled
Message="A SQL Server Compact DLL could not be loaded. Reinstall SQL
Server Compact Edition. [ DLL Name = sqlcese35.sys.dll ]"
HResult=-2147467259
NativeError=25123
Source="SQL Server Compact ADO.NET Data Provider"
StackTrace:
at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
at System.Data.SqlServerCe.SqlCeConnection.Open()
I have tried to install the 3 sqlce CAB files using the command line version
of wceload but when I do this I get
Failed to add assembly: System.Data.SqlServerCe.Resources.dll
putting the sqlcese35.dll in the application directory doesn't work ( have
tried putting all the dll's in with the app)
I wrote an app that just tries to load the dll's with LoadLibrary like this:
private static void PreLoadSqlCe()
{
string sqlCeInstallPath =
(string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft
SQL Server Compact Edition\v3.5",
"InstallDir", string.Empty);
if (string.IsNullOrEmpty(sqlCeInstallPath))
{
return;
}
string[] sqlCeDlls = new string[]
{
"sqlceoledb35.dll",
"sqlcese35.dll",
"sqlceqp35.dll",
"sqlceme35.dll",
"sqlceca35.dll",
"sqlcecompact35.dll"
};
foreach (string dllName in sqlCeDlls)
{
Debug.WriteLine("--> Preloading SqlCe DLL: " + dllName);
string fullPath = Path.Combine(sqlCeInstallPath, dllName);
IntPtr result = LoadLibrary(fullPath);
if (result != IntPtr.Zero)
{
Debug.WriteLine(string.Format("An error occurred while
pre-loading the native DLL '{0}' Error{1}.",
dllName,Marshal.GetLastWin32Error()));
}
if (File.Exists(fullPath))
{
FileVersionInfo info =
FileVersionInfo.GetVersionInfo(fullPath);
Debug.WriteLine(info.FileName);
Debug.WriteLine(string.Format("Build:{0} Major:{1}
Minor:{2}", info.FileBuildPart, info.FileMajorPart, info.FileMinorPart));
Debug.WriteLine(string.Format("PBuild:{0} PMajor:{1}
PMinor:{2}", info.ProductBuildPart, info.ProductMajorPart,
info.ProductMinorPart));
}
}
}
Output from this code is:
--> Preloading SqlCe DLL: sqlceoledb35.dll
An error occurred while pre-loading the native DLL 'sqlceoledb35.dll' Error0.
sqlceoledb35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlcese35.dll
sqlcese35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlceqp35.dll
An error occurred while pre-loading the native DLL 'sqlceqp35.dll' Error87.
sqlceqp35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlceme35.dll
An error occurred while pre-loading the native DLL 'sqlceme35.dll' Error87.
sqlceme35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlceca35.dll
sqlceca35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlcecompact35.dll
An error occurred while pre-loading the native DLL 'sqlcecompact35.dll'
Error87.
sqlcecompact35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
I also used opennetcf's smart device framework to look at the memory load as
I read that insufficient virtual memory would cause a dll to fail to load.
This is the output directly after the Open exception:
Available Physical Memory:114MB
Availabel Virtual Memory:1041MB
MemoryLoad:8
System Program Memory:121MB
SystemStorageMemory:121MB
Total Physical Memory:124MB
Total Virtual Memory:1048MB
I'm at my wits end and considering sending a jug of Maple syrup to the first
person that helps me figure this out......
hardware.
CE 6.0 R3, Updates to Dec 2009 Rollup
Hardware is a Headless x86 device (iCop VDX-6315)
Included in the OS image that I am building:
SQL Compact
SQL Compact Managed Provider
.NET Compact Framework 3.5 Headless
.NET Compact Framework String Resources - Headless
OS Dependencies for .NET Compact Framework 3.5 - Headless
Using Hive based registry
I have an application (using SQL ce) that I have been running on an x86
system with a display for two years, I hit this problem when I first tried to
run it on the headless device. To simplify things I made a test application
(VS2008) which is basically the Microsoft example using the northwind
database.
I do not get the dreaded PInvoke error but I get this on connection.Open():
System.Data.SqlServerCe.SqlCeException was unhandled
Message="A SQL Server Compact DLL could not be loaded. Reinstall SQL
Server Compact Edition. [ DLL Name = sqlcese35.sys.dll ]"
HResult=-2147467259
NativeError=25123
Source="SQL Server Compact ADO.NET Data Provider"
StackTrace:
at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
at System.Data.SqlServerCe.SqlCeConnection.Open()
I have tried to install the 3 sqlce CAB files using the command line version
of wceload but when I do this I get
Failed to add assembly: System.Data.SqlServerCe.Resources.dll
putting the sqlcese35.dll in the application directory doesn't work ( have
tried putting all the dll's in with the app)
I wrote an app that just tries to load the dll's with LoadLibrary like this:
private static void PreLoadSqlCe()
{
string sqlCeInstallPath =
(string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft
SQL Server Compact Edition\v3.5",
"InstallDir", string.Empty);
if (string.IsNullOrEmpty(sqlCeInstallPath))
{
return;
}
string[] sqlCeDlls = new string[]
{
"sqlceoledb35.dll",
"sqlcese35.dll",
"sqlceqp35.dll",
"sqlceme35.dll",
"sqlceca35.dll",
"sqlcecompact35.dll"
};
foreach (string dllName in sqlCeDlls)
{
Debug.WriteLine("--> Preloading SqlCe DLL: " + dllName);
string fullPath = Path.Combine(sqlCeInstallPath, dllName);
IntPtr result = LoadLibrary(fullPath);
if (result != IntPtr.Zero)
{
Debug.WriteLine(string.Format("An error occurred while
pre-loading the native DLL '{0}' Error{1}.",
dllName,Marshal.GetLastWin32Error()));
}
if (File.Exists(fullPath))
{
FileVersionInfo info =
FileVersionInfo.GetVersionInfo(fullPath);
Debug.WriteLine(info.FileName);
Debug.WriteLine(string.Format("Build:{0} Major:{1}
Minor:{2}", info.FileBuildPart, info.FileMajorPart, info.FileMinorPart));
Debug.WriteLine(string.Format("PBuild:{0} PMajor:{1}
PMinor:{2}", info.ProductBuildPart, info.ProductMajorPart,
info.ProductMinorPart));
}
}
}
Output from this code is:
--> Preloading SqlCe DLL: sqlceoledb35.dll
An error occurred while pre-loading the native DLL 'sqlceoledb35.dll' Error0.
sqlceoledb35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlcese35.dll
sqlcese35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlceqp35.dll
An error occurred while pre-loading the native DLL 'sqlceqp35.dll' Error87.
sqlceqp35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlceme35.dll
An error occurred while pre-loading the native DLL 'sqlceme35.dll' Error87.
sqlceme35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlceca35.dll
sqlceca35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
--> Preloading SqlCe DLL: sqlcecompact35.dll
An error occurred while pre-loading the native DLL 'sqlcecompact35.dll'
Error87.
sqlcecompact35.dll
Build:5692 Major:3 Minor:5
PBuild:5692 PMajor:3 PMinor:5
I also used opennetcf's smart device framework to look at the memory load as
I read that insufficient virtual memory would cause a dll to fail to load.
This is the output directly after the Open exception:
Available Physical Memory:114MB
Availabel Virtual Memory:1041MB
MemoryLoad:8
System Program Memory:121MB
SystemStorageMemory:121MB
Total Physical Memory:124MB
Total Virtual Memory:1048MB
I'm at my wits end and considering sending a jug of Maple syrup to the first
person that helps me figure this out......