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 8453599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:48:39+00:00 2026-06-10T11:48:39+00:00

First – if anyone has an entity model with DB2 working, can you please

  • 0

First – if anyone has an entity model with DB2 working, can you please post it? And now for the explanation:

I have a development environment that has a SQL Server database (just for development) and uat/production environments with a DB2 database (more or less the same db, just on a different platform)

Using Visual Studio 2010 I can successfully generate an entity framework model against the SQL Server database, but not against DB2. I have DB2 9.7 client as well as the ‘IBM Database Add-ins for Visual Studio’ installed which allows me to create connections to the DB2 database and connect to it via Server Explorer, but when I try to generate a model from DB2 Visual Studio hangs and eventually I get an empty model.

Since I can generate a model from SQL Server, I am wondering if it is an easy switch to just change the web.config to point to DB2 instead of SQL Server when my environment switches.

Is anyone out there using entity framework with DB2, and if so can you please post your web.config so I can try just switching providers?

  • 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-06-10T11:48:40+00:00Added an answer on June 10, 2026 at 11:48 am

    Two changes are necessary to switch your entity model to connect to DB2. Depending on what version of what you have this obviously may change. .edmx change:

    <!-- SQL SERVER <Schema Namespace="Models.myDb2Model.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008"                  xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">-->
                    <Schema Namespace="Models.myDb2Model.Store" Alias="Self" Provider="IBM.Data.DB2"          ProviderManifestToken="DB2, 09.01.0005, 0, 0" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
    

    And here is the web.config change:

     <!-- SQL SERVER<add name="db2Connection" 
         connectionString="metadata=res://*/Models.db2Entities.csdl|res://*/Models.db2Entities.ssdl|res://*/Models.db2Entities.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=localhost;initial catalog=mySqlServerDb;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" 
         providerName="System.Data.EntityClient" /> -->
    
      <add name="db2Connection" 
           connectionString="metadata=res://*/Models.db2Entities.csdl|res://*/Models.db2Entities.ssdl|res://*/Models.db2Entities.msl;provider=IBM.Data.DB2;provider connection string=&quot;Database=myDb2Db;User ID=myUserId;Password=MyPassword;Server=myServerName:myPort;DBName=myDbName;ConcurrentAccessResolution=Currentlycommitted;CurrentPackageSet=myCurrentPackageSet&quot;" 
           providerName="System.Data.EntityClient" />
    

    Edit: obviously your machine needs to be set up to connect to DB2, have the proper client and database add ins for VS.

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

Sidebar

Related Questions

first take a look on this picture from localScope app : i have 2
First, some context: I'm a Python developer who has written a medium-sized application using
First you should know I have looked into many questions and none of them
First I want to thank you guys here, because your posts have gotten me
First time posting here, will try to be succinct. This is a classic 'can't
First, I have a dbcontext factory which is defined public class DatabaseFactory : Disposable,
First of all i have to those categoryIDs 1-whos parentcategoryID only appears one 2-ParentCategoryID
First, I have a list of QWidget s that I won't know the length
First, about me: My language is objective-c, c++. I have built websites in the
First, please forgive (and correct!) any misconceptions - I'm brand new to anything .NET.

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.