I am getting following error:
Error 1 The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Adnan\My Documents\Visual Studio 2005\Projects\Mobile5\Mobile5\Form1.cs 20 4 Mobile5
the line which caused problem is
System.Data.SqlServerCe.SqlCeConnection conn = null;
following are being used as reference
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Data.SqlServerCe;
using System.Data.SqlClient;
PLease guide me

sql connection error
Harvey Norman
My email is IlyaTum with addition of (at)microsoft.com.
(Sorry I've to be cryptic - don't like spam).< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
By the way, have you tried fresh NETCF V2 project with some line like this in it
SqlCeConnection conn = new SqlCeConnection();
Can you compile and run any NETCF project
jvds
This happened to me once.
I made a reference to a somehow incorrect version of System.Data.SqlServerCe.dll
Flamin
thanks for reply
Yes i am adding the SQLServerCE dll files,the System.DATA was added automatically when i created new WindowsMObile5 Smartphone project,its still keep giving the error
can you guide the location of required dll files because the default dlls are not being accepted
Ulrik Sorensen
Thanks a lot.
persistent me
Hi,
Could you report this to Product Feedback Also, keep me posted on their reply...
cheers,
Paul June A. Domag
mlal
There's no mystery here, you have a reference to desktop assembly in CF application which is not allowed. Look at PublicKeyToken (PKT):
Desktop's PKT: b77a5c561934e089
NETCF PKT: 969DB8053D3322AC
< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
MichaelJH
i coudn`t resolve the mystery,i wasn`t right in my earlier post,now even defining complete class scheme,its compiling perfectly,i dont have any clue why it wasn`t working earlier and why working now,all i did that i created new mobile project
that`s it
-adnan
CodeMission
C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0\System.Data.SqlServerCe.dll
If your project was converted, you might want to create a new NETCF V2 project and add all files from the old one instead of using conversion.
If you have some other DLLs in your project, make sure they are NETCF compatible.
You can open them with ILDASM tool and check out references in manifest. Make sure PKT for framework assemblies is "96 9D B8 05 3D 33 22 AC". For example:
.assembly extern mscorlib
{
.publickeytoken = (96 9D B8 05 3D 33 22 AC ) // ....=3".
.ver 2:0:0:0
}
If you see another PKT, this DLL is not NETCF compatible.
Leonnuel
Hi,
I guess you'll have to manually add the reference to System.Data or System.Data.SqlServerCe.
Procedure:
1. Right click References in your Solution Explorer.
2. Select Add Reference.
3. Navigate and find System.Data or System.Data.SqlServerCe. Select Add.
I was assuming that this would be added by default to your reference...
cheers,
Paul June A. Domag
M. Carr
Hi,
Hmmm. This is puzzling. The required dll's that was included in the installation should be in the GAC. What VS version are you using Could you create a small project that just access the database
cheers,
Paul June A. Domag
Hugues van Wassenhove
C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v2.0
C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
C:\Program Files\Microsoft Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE
Thanks for help.
thegallery
its weird,what i did that i started new project and instead of
System.Data.SqlServerCe.SqlCeConnection conn = null;
i wrote
SqlCeConnection conn = null;
and it compiled
i coudn`t understand the mystery
Bin Zhou
I'm having this same problem.
Thanks
fredz28
Hi Adnan,
I am facing the same problem as you were facing, how did you solve the problem, can you assist me from begining, since i am new to this platform. I am using Visual Studio 2005 with SP1 and also installed "Microsoft SQL Server Compact Edition" separately.Your reply will be great helpfull to me.
Thanks in advance
Amit