注册 登录
编程论坛 ASP.NET技术论坛

哥哥们来帮忙下,

myanos 发布于 2012-10-16 21:34, 825 次点击
哥哥们来帮忙下,,按照这个程序的作者改了相应的地方都不行 不是报错就是连接不上数据库,请哥哥们帮忙看看。
以下是代码
<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website-> Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine. usually located in
    \Windows\\Framework\v2.x\Config
-->
<configuration>
  <appSettings>
    <add key="ConnString" value="Data Source=TONG\SQLEXPRESS;Initial Catalog=PCMSys;User ID=sa;Password=sa"/>
  </appSettings>
    <connectionStrings>
  <add name="PCMSysConnectionString" connectionString="Data Source=TONG\SQLEXPRESS;Initial Catalog=PCMSys;User ID=sa;Password=sa"
   providerName="System.Data.SqlClient" />
  <add name="PCMSysConnectionString2" connectionString="Data Source=TONG\SQLEXPRESS;Initial Catalog=PCMSys;User ID=sa;Password=sa"
   providerName="System.Data.SqlClient" />
 </connectionStrings>
    <system.web>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
        <compilation debug="true"/>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
             to identify an incoming user.
        -->
        <authentication mode="Windows"/>
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    </system.web>
</configuration>
6 回复
#2
yms1232012-10-24 11:59
报什么错误
#3
荷塘5月色2012-10-26 20:55
为什么飞的用config来编写连接数据库呢。多麻烦啊。而且还容易错。你试试正常的连接可否成功
#4
zzqqrr2012-10-26 21:57
看了一下有几个地方都有字符串,找一下看他读的是哪个就知道了,看下来读这个config的是读的哪个,就改哪个,
#5
痞子,赵2012-11-14 16:36
或许是source和key 后的代码问题
#6
awl8052012-11-14 20:34
连接字符串一个就好了,我一般用这个字符串"Server=.;database=basename;uid=sa;password=pw;"
#7
烧包谷2012-12-04 21:33
LZ你的数据库用户名和密码是这个吗?还有你的数据库安装时的验证方式是sql-server验证方式吗?
1