General information
Category:
The Mere Mortals .NET Framework
Title:
Problem with SQL connection in sample app
Environment versions
Network:
Windows 2003 Server
I recently installed the new 6/13/2008 release of MM.NET. I changed the App.config files in both the Business object project and the windows forms project and copied the connection string straight from the properties of the Server Explorer | Data Connection in Visual Studio 2008.
Whenever I try to run the sample app, I get a SQL client error. From the stack (below) it looks to me that there is a problem somewhere in that I am using a named instance of SQL Server. Please note that "Server" line near the top of the call stack shows two backslashes:
Server="DIS-PMCDERMOTT2\\PMCDDEV"
Here's my connection string from the App.config:
"Data Source=DIS-PMCDERMOTT2\PMCDDEV;Initial Catalog=Northwind;Integrated Security=True" (Only one backslash)
My suspicion is this is an issue with a missing escape character for C# somewhere that is not liking the backslash in a named instance SQL name.
Anyone have any ideas how to fix this? I'm at a loss. TIA.
Patrick
System.Data.SqlClient.SqlException was unhandled
Message="Invalid object name 'Message'."
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=16
LineNumber=1
Number=208
Procedure=""
Server="DIS-PMCDERMOTT2\\PMCDDEV"
State=1
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
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(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbDataAdapter dbAdapter, String tableName, Boolean clearOnFill)
at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbCommand command, String tableName, Boolean clearOnFill)
at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, String command, String tableName, CommandType cmdType, IDbDataParameter[] dataParms, Boolean clearOnFill)
at OakLeaf.MM.Main.Business.mmBusinessObject.FillDataTable(DataSet ds, String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] cmdParams)
at OakLeaf.MM.Main.Business.mmBusinessObject.FillDataSet(DataSet ds, String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] cmdParams)
at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] dataParams)
at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, String databaseKey, IDbDataParameter[] dataParams)
at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataSet(String command, String tableName, IDbDataParameter[] dataParams)
at OakLeaf.MM.Main.Globalization.mmMessageManager.GetAllMessages(Object languagePK)
at OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessageCache(Object LanguagePk, Boolean ForceReload)
at OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessageCache(Object LanguagePk)
at OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessage(String messageKey, Object languagePK, Boolean returnMessageKeyIfNotFound)
at OakLeaf.MM.Main.Globalization.mmMessageManager.GetMessage(String messageKey, Object languagePK)
at OakLeaf.MM.Main.Windows.Forms.mmBaseForm.LocalizeText(Object languagePK)
at OakLeaf.MM.Main.Windows.Forms.mmBusinessBaseForm.LocalizeText(Object languagePK)
at OakLeaf.MM.Main.Windows.Forms.mmBaseForm.set_Text(String value)
at OakLeaf.MM.Main.Windows.Forms.mmBaseForm.InitializeComponent()
at OakLeaf.MM.Main.Windows.Forms.mmBaseForm..ctor()
at OakLeaf.MM.Main.Windows.Forms.ILBaseForm..ctor()
at OakLeaf.MM.Main.Windows.Forms.mmBusinessBaseForm..ctor()
at OakLeaf.MM.Main.Windows.Forms.mmEntityBusinessForm..ctor()
at OakLeaf.MM.Main.Windows.Forms.mmBusinessForm..ctor()
at OakLeaf.MM.Main.Windows.Forms.mmExceptionForm..ctor(String exception, String stackTrace)
at OakLeaf.MM.NorthwindSample.Main.AppMainEntry.Main() in C:\Program Files\Mere Mortals .NET Framework 2008\Samples\MM Northwind Sample Application_CSharp\Main.cs:line 88
InnerException:
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only