Question 'System.Data.Common.DbDataReader' is defined in an assembly that is not referenced

SSi_Cincinnati

New member
Joined
Feb 15, 2010
Messages
4
Programming Experience
3-5
I am working on a program for a Windows CE machine, and when I create the SqlCeDataReader, SqlCeConnection, and SqlCeCommand variables, I get the above message telling me I need to reference System.Data version 2.0.0.0 (which I have). Why will this not compile?
System Info:
Windows XP SP3
VS 2008 Pro
I have the 3.5 SP2 version of the SQL Compact installed
 
Not sure why this fixed it, but I was referencing the System.Data.dll in C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\, so I switched the reference to the System.Data.dll in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\. Not sure if that will have an effect on the Windows CE device or not...
 
It absolutely will because you are referencing an assembly from the full Framework instead of the Compact Framework. If you're deploying to a mobile device then only the CF will be available. It sounds like you may have referenced the wrong version of the SQL Server CE provider. I've never developed a mobile app but I'd imagine that there's a full version and a CF version.
 
Back
Top