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=184.108.40.206, 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
PLease guide me
I guess you'll have to manually add the reference to System.Data or System.Data.SqlServerCe.
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...
Paul June A. Domag
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
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
Where should I find correct file? I tried files under following locations and it's giving me same error...
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.
For NETCF V2 project correct SQL Mobile provider is:
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".
If you see another PKT, this DLL is not NETCF compatible.
My email is IlyaTum with addition of (at)microsoft.com.
(Sorry I've to be cryptic - don't like spam).
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?
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
I have had the same problem after installing SQL Server Compact edition
I get the error if I reference the path
1. C:\Program Files\Microsoft SQL Server Compact Edition\v3.1\System.Data.SqlServerCe.dll
This reference has a file version of 220.127.116.110.00, but an Assembly version of 18.104.22.168
I don't get the error if I use these specific references.
These have a file version of 22.214.171.1240.00, but an Assembly version of 3.0.3600.0
C:\Program Files\Microsoft SQL Server Compact Edition\v3.1\SDK\bin\wce500\System.Data.SqlServerCe.dll
C:\Program Files\Microsoft SQL Server Compact Edition\v3.1\SDK\bin\wce400\System.Data.SqlServerCe.dll
I haven't tried them in actual code yet.