Visual Studioで正常に機能するソフトウェアを作成しました。しかし、任意のコンピューターに展開すると、データベースへの接続を試みているときに次のエラーが発生します:-
************** Exception Text **************
System.InvalidOperationException: The ConnectionString property has not been initialized.
at System.Data.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at DentalGood.frmLogin.startLogin() in E:\PRGS\DentalGood\DentalGood\frmLogin.cs:line 28
at KryptonForm.frmMain.btnLogin_Click(Object sender, EventArgs e) in E:\PRGS\DentalGood\DentalGood\frmMain.cs:line 216
at ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupButton.OnClick(EventHandler finishDelegate)
at ComponentFactory.Krypton.Ribbon.KryptonRibbonGroupButton.PerformClick(EventHandler finishDelegate)
at a5.d(Object A_0, EventArgs A_1)
at eq.b(Object A_0, EventArgs A_1)
at ek.b(EventArgs A_0)
at ek.a(Control A_0, Point A_1, MouseButtons A_2)
at ComponentFactory.Krypton.Toolkit.ToolTipController.MouseUp(Control c, Point pt, MouseButtons button)
at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
at ComponentFactory.Krypton.Toolkit.ViewManager.MouseUp(MouseEventArgs e, Point rawPt)
at ComponentFactory.Krypton.Toolkit.ViewControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at ComponentFactory.Krypton.Toolkit.ViewControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.6400 (Win8RTMGDR.050727-6400)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
program.cs ファイルで ConnectionString を初期化しました。接続文字列をファイルに保存し、接続が必要になるたびに読み込みます。助けはありますか?