Web.Congif里面配置为:
<add name="strConn" connectionString="Data Source=WANGKUNMING;Initial Catalog=ThreeDoor;Integrated Security=True"/>可运行时报错说是:
在 ConnectionString 中未指定 OLE DB 提供程序。示例为:“Provider=SQLOLEDB;”。如果我添加Provider=SQLOLEDB改成:
<add name="strConn" connectionString="Data Source=WANGKUNMING;Initial Catalog=ThreeDoor;Integrated Security=True"/>报错说是:
没有可用的错误消息,结果代码: DB_E_ERRORSOCCURRED(0x80040E21)。急求答案,谢谢
根据网友提供信息说:
<add name="strConn" connectionString="Data Source=WANGKUNMING;Initial Catalog=ThreeDoor;Integrated Security=True" providerName="System.Data.SqlClient"/> 加了个providerName="System.Data.SqlClient"
还是报同样的错

解决方案 »

  1.   

    string strCon = "Data Source=(local);Database=BooksManage;Uid=sa;Pwd=5354";
      

  2.   

    你看看我的
    《add key="abc" value="server=WWW-53244466\ML210;database=grg3;uid=sa;pwd=1234"/>WWW-53244466\ML210为计算机名
    grg3为数据库名
    uid=sa;pwd=1234账号,密码
      

  3.   

    我看是你代码写错了,应该用SqlConnection 而不是OleDbConnection
      

  4.   

    string PubConn= "Data Source=(local);Database=Check;Uid=sa;Pwd=123";
      

  5.   

    Web.Configadd name="strConn" connectionString="Data Source=WANGKUNMING;Initial Catalog=ThreeDoor;Persist Security Info=True;User ID=SA;Password=1234"
     providerName="System.Data.SqlClient"
      

  6.   

    一句提醒了我。之前我用的是Access,链接字符串什么都没改