Click here to Skip to main content
15,885,007 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
I have created a wcf service I run it indivudually and use that service reference it is working .
Then I hosted the service the database is not working .

this is my connection string of sql odbc database
string s = "dsn=agent1;Trusted_Connection=True";

web.config file of WCF


XML
<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>



before hosting in IIS it worked but after hosting this is error code
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Posted
Updated 16-Aug-13 4:21am
v2

1 solution

The error is created because the code is specifying a DSN that does not exist.
That is "agent1".So you have to create it on your IIS server's Data Sources (ODBC).

To see your existing DSN"s go to Control Panel - Data Sources (ODBC).If it does not then create one.

For more info check this:

https://community.microfocus.com/borland/test/silk_test/w/knowledge_base/10737.how-do-i-resolve-error-im002-microsoft-odbc-driver-manager-data-source-name-not-found-and-no-default-driver-specified.aspx[^]

I hope this will help to you.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900