MS SQLデータベースを使用するWindowsアプリケーション(2.0フレームワーク)を作成しました。
開発中に私はMS VISUAL STUDIO 2010とSQL 2008 MANAGEMENT STUDIOを使用しました。開発中
私の接続文字列は次のとおりです。C#WindowsアプリケーションでのMS SQL Server 2008 R2 EXPRESSの使用?
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=SL;Integrated Security=True");
すべてが正常に動作します....
今私は、クライアント・システム上でこのアプリケーションを実行します。
クライアントシステムにMS SQL SERVER 2008 EXPRESSが正常にインストールされました。
私のシステムのSQLサービスが停止し、マシンから.mdfと.ldfファイルがコピーされ、クライアントの "c:\ Database \"に貼り付けられました。 しかし、実行中に問題が発生します。
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)
私は何度も試した接続文字列は、次のとおりです。私は、接続文字列でUser ID=sa;Password=pass
を使用する場合
SqlConnection con = new SqlConnection("Data Source=.\\MSSQLEXPRESS;Initial Catalog=SL;Integrated Security=True");
SqlConnection con = new SqlConnection("Data Source=.\\MSSQLEXPRESS;Initial Catalog=SL;Persist Security Info=True;User ID=sa;Password=pass");
SqlConnection con = new SqlConnection("Data Source=.\\MSSQLEXPRESS; AttachDbFilename =C:\\Database\\SL.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
は私が取得:
authentication failed for 'sa'
は、私はいくつかのステップを見つからないかやっています違う?私のシステムからデータベースをコピーした後に何をすべきか教えてください。私の接続文字列はC#ですべきですか?
ありがとうございます!
はい...すなわちMSSQLEXPRESS。 –