System.Data.SqlServerCe

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LitaOsiris
    New Member
    • Jan 2008
    • 16

    System.Data.SqlServerCe

    Hi all,

    I'm getting the following error:

    The type 'System.Data.Co mmon.DbConnecti on' 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= b77a5c561934e08 9'.

    and it's the same for

    System.Data.Com mon.DbCommand
    System.Data.Com mon.DbDataAdapt er



    The code is using

    using System.Data.Sql ServerCe;

    with a reference path to

    C:\Program Files\Microsoft SQL Server Compact Edition\v3.1\Sy stem.Data.SqlSe rverCe.dll

    The various database commands look like this:

    SqlCeConnection conn = new SqlCeConnection (stringConnecti on);

    This program is running on a Windows CE5 handheld and it was all fine before it was decided to upgrade from SQL Server 2005 to SQL Server 2008. I got the same errors when using 2008 so I thought that going back to 2005 would resolve them, but it's still the same. I have removed all .Net Frameworks and even re-installed version 2 but still it's the same.

    I have installed:
    - SQL Server 2005 with tools (Management Studio)
    - SQL Server 2005 Compact 3.1
    - .Net Framework 2

    Does anyone know what will make this work again?
  • LitaOsiris
    New Member
    • Jan 2008
    • 16

    #2
    I got this working in the end but just by using an untouched copy of VS 2005 and SQL Server 2005 on another machine. We tried upgrading the program to 2008 but that caused the following error on the handheld (Windows CE):

    You are trying to access an older version of SQL Server Mobile database. If this is a SQL Server CE 1.0 or 2.0 database, run upgrade.exe. If this is a SQL Server Mobile 3.0 or later database, run Compact/Repair. [Db version=3505053 , Requested version=3004180 ....

    We use a Resco SmartGrid in the handheld app and this was actually what was causing the problem. They have a 2005 series and now a 2009 one. 2005 obviously isn't compatible with 2008 SQL Server and VS 2008 won't recognise the control from the toolbox to add a new one but it will still compile. So because of that fact I didn't think it was an issue. 2009 works fine and it would have probably been easier just to upgrade to 2009 but it costs money and recession times makes that hard to do so we'll just make do for the moment.

    I was running:
    .Net Framework 3.5
    VS 2008
    SQL Server 2008
    and with the evaluation version of the Resco MobileForms Toolkit 2009 the program was running the exact same on the handheld.

    I'm not sure why I couldn't get my machine fully back to 2005 but that doesn't matter now. After spending a full day installing programs and watching progress bars I'm not going through that again ;)

    Comment

    Working...