-1

我无法连接到我的本地数据库,它在实时版本上运行良好。Live 版本是 SQL Server 2012,测试环境是 SQL Server 2014 Express。

我正在使用 Web Matrix 3 和附加到进程的 Visual Studio 2013 调试器,但我现在几乎尝试了所有方法?我认为问题与连接问题有关。但我当然可以从 Management Studio 连接到数据库。

这是我的连接字符串

  <connectionStrings>
    <add name="ConStrLive" providerName="System.Data.SqlClient" connectionString="Data Source=127.0.0.1;Initial Catalog=lastbilmagasinet_dk;Persist Security Info=True;User ID=lastbilmagasinet;Password=xxxx;Max Pool Size=10000" />
    <add name="ConStrDev" providerName="System.Data.SqlClient" connectionString="Data Source=DVSRV;Initial Catalog=lastbilmagasinet_dk;Persist Security Info=True;User ID=intern;Password=xxxx!;Max Pool Size=10000" />
    <add name="ConStrLB" providerName="System.Data.SqlClient" connectionString="Data Source=127.0.0.1;Initial Catalog=lastbilbasen_dk;Persist Security Info=True;User ID=lastbilbasen;Password=xxxx;Max Pool Size=10000" />
    <add name="ConStrLMBanner" providerName="System.Data.SqlClient" connectionString="Data Source=127.0.0.1;Initial Catalog=lmbanner_dk;Persist Security Info=True;User ID=lmbanner;Password=xxxx;Max Pool Size=10000" />
    <add name="ConStrFragtbasen" providerName="System.Data.SqlClient" connectionString="Data Source=127.0.0.1;Initial Catalog=fragtbasen_dk;Persist Security Info=True;User ID=fragtbasen;Password=xxxx;Max Pool Size=10000" />
    <add name="ConStrTransjob" providerName="System.Data.SqlClient" connectionString="Data Source=127.0.0.1;Initial Catalog=transportjobbasen_dk;Persist Security Info=True;User ID=transportjobbasen;Password=xxxx;Max Pool Size=10000" />
    <add name="ConStrLastbilshow" providerName="System.Data.SqlClient" connectionString="Data Source=127.0.0.1;Initial Catalog=lastbilshow_dk;Persist Security Info=True;User ID=lastbilshow;Password=xxxx;Max Pool Size=10000" />
    <add name="ConStrTruckpadborg" providerName="System.Data.SqlClient" connectionString="Data Source=127.0.0.1;Initial Catalog=truckpadborg_dk;Persist Security Info=True;User ID=truckpadborg;Password=xxxx;Max Pool Size=10000" />
  </connectionStrings>

有人有什么想法吗?

4

1 回答 1

0

问题是数据源。显然 MSSQL 不允许 127.0.0.1 或 localhost 作为本地数据源,或者我的默认配置也没有。

所以连接字符串中的数据源必须是 WIN-BD4MCUAKPRP\SQLEXPRESS。然后它起作用了:)

于 2015-02-27T07:46:01.020 回答