2016-10-03 6 views
0

ローカルのPCにASP.NET MVCをセットアップしました。 SQL Server Management Studioでデータベースをセットアップし、接続文字列をweb.configに設定しました。 VS2015のサーバーエクスプローラに移動すると、データコネクションにDBが表示されます。私がサイトを起動し、ユーザーをしようとすると、登録している場合しかし、私は次のエラーを取得する:.net SQLサーバーデータベースに接続

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

私はVS2015

私の中のデータ接続でそれを見ることができるので、文字列が正しいことを知っています次のようにweb.configは次のとおりです。

<entityFramework> 
    <defaultConnectionFactory 
      type="System.Data.Entity.Infrastructure.SqlConnectionFactory, 
EntityFramework" /> 
    <providers> 
     <provider invariantName="System.Data.SqlClient" 
        type="System.Data.Entity.SqlServer.SqlProviderServices, 
EntityFramework.SqlServer" /> 
    </providers> 
</entityFramework> 
<connectionStrings> 
    <add name="ForexRebatesNowDBEntities" 
     connectionString="metadata=res://*/Models.ForexRebatesNowEntities.csdl|res://*/Models.ForexRebatesNowEntities.ssdl|res://*/Models.ForexRebatesNowEntities.msl;provider=System.Data.SqlClient;provider 
connection string=&quot;data source=MSIBEEDGE;initial 
catalog=ForexRebatesNowDB;persist security info=True;user 
id=sa;password=********;MultipleActiveResultSets=True;App=EntityFramework&quot;" 
     providerName="System.Data.EntityClient" />  
</connectionStrings> 

これが私のうちの生活をイライラさせられます!私は、アプリケーションがSQL Serverに書き込むことができない方法を理解できません

+0

は、名前の代わりに、SQL ServerのIPアドレスを使用してみてください:

記事は下記をチェックするための手順があります。 SQL Serverは、リモート接続も可能にするように設定する必要があります。 – logixologist

+0

ローカルからSQL Server Management Studioに接続してみてください。それはあなたにとって良い兆候になるでしょう。 – logixologist

+0

サーバーエクスプローラの接続文字列とWeb.configの接続文字列を比較して、違いを確認してください。 – user2773289

答えて

関連する問題