在IIS odbc驱动程序中发现WCF未找到错误 [英] Hosting WCF in IIS odbc driver not found error
问题描述
我创建了一个wcf服务,我单独运行它并使用它正在运行的服务引用。
然后我托管了数据库无法正常工作的服务。
这是我的连接字符串sql odbc数据库
string s =dsn = agent1; Trusted_Connection = True;
WCF的web.config文件
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 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>
在IIS中托管之前它有效但托管后这是错误代码
错误[IM002] [微软] [ODBC驱动程序管理器]数据源名称找不到并且没有指定默认驱动程序
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
推荐答案
创建错误是因为代码指定了不存在的DSN。
即agent1。因此,您必须在IIS服务器的数据源(ODBC)上创建它。
查看您现有的DSNs转到控制面板 - 数据源(ODBC)。如果没有,则创建一个。
有关详细信息,请查看:
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 [ ^ ]
我希望这会对你有所帮助。
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.
这篇关于在IIS odbc驱动程序中发现WCF未找到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!