Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7501067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:24:42+00:00 2026-05-29T20:24:42+00:00

I am having trouble using a .sdf database file with Ling2SQL. I am working

  • 0

I am having trouble using a .sdf database file with Ling2SQL. I am working with VS2010 on .NET 3.5. What I have done so far:

  1. Created sdf file and added tables and data (located in project folder)
  2. Copied SQLMetal.exe and SqlMetal.exe.config to the project folder and called it with:

    SQLMetal.exe database.sdf /dbml:DataOffline.dbml /namespace:CTcalc /pluralize
    
  3. Added dbml file to the project (designer.cs is created)

  4. Add new method to designer.cs

    public DataOfflineDataContext() : 
            base(global::CTcalc.Properties.Settings.Default.databaseOfflineConnectionString, mappingSource)
    {
        OnCreated();
    }
    
  5. Add connectionString to settings file (type:connectionString)

    Data Source=|DataDirectory|\database.sdf
    
  6. Using the connection:

    using (DataOfflineDataContext dc = new DataOfflineDataContext())
                lProtFunc = (from c in dc.ProtectionFunctions select c).ToList();
    

When debugging my project, I get an BadImageFormatException error with HRESULT: 0x8007000B

I have no idea how to fix it. Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:24:48+00:00Added an answer on May 29, 2026 at 8:24 pm

    My fault was using the wrong .dll within my project.

    I used

    Program Files\Microsoft SQL Server Compact Edition\v3.5\Desktop\System.Data.SqlServerCe.dll
    

    instead of

    Program Files\Microsoft SQL Server Compact Edition\v3.5\Private\System.Data.SqlServerCe.dll
    

    Now it is working!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble using JQuery with ASP.net. I have a HTML img ,
Im having trouble using a .NET COM in vb6, It compiles ok and I
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
Hello I am having trouble using multiquery in facebook .net. I am trying to
I'm having trouble using contentEditable in FireFox 3. I have a problem where the
I'm having trouble using .htaccess. This is the content of my .htaccess file RewriteEngine
I'm having trouble using special characters with &-notation in ruby on rails forms. Have
I'm having trouble using the Powershell CmdLet Test-Path. I created a Share on a
I'm having trouble deploying an ASP.Net application using Sql Server CE 4.0. I get
I'm having trouble using db.ReferenceProperty with PolyModel in GAE. If I have two models

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.