I have created a SQL 2005 DB on our server for my CSLA 3.5 application. Previously, I was running it locally. But, since my company can't seem to get it's act together to get me a new machine that can handle multiple instances of VS2008 open, SQL Enterprise manager open and etc., I created the DB on our production server. And no, they do not want to buy a test server for me to develop on. Yea, things could get very interesting very soon.
Anyway, I changed the appconfig connection string to be:
<connectionStrings>
<add name="BAS2005" connectionString="Data Source=(ggba001);Initial Catalog=BAS2005;Integrated Security=true;Connection Timeout=2;" providerName="System.Data.SqlClient" />
<add name="BAS2005Security" connectionString="Data Source=(ggba001);Initial Catalog=BAS2005Security;Integrated Security=true;Connection Timeout=2;"providerName="System.Data.SqlClient" />
</connectionStrings>
instead of:
<connectionStrings>
<add name="BAS2005" connectionString="Data Source=(local);Initial Catalog=BAS2005;Integrated Security=true;Connection Timeout=2;" providerName="System.Data.SqlClient" />
<add name="BAS2005Security" connectionString="Data Source=(local);Initial Catalog=BAS2005Security;Integrated Security=true;Connection Timeout=2;"providerName="System.Data.SqlClient" />
</connectionStrings>
and now I am getting the message:
Csla.DataPortalException was unhandled
Message="DataPortal.Fetch failed (An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server))"
Source="Csla"
StackTrace:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at BAS.Security.Library.BASIdentity.DataPortal_Fetch(CredentialsCriteria criteria) in C:\Visual Studio 2008\CSLA Framework\BAS\BAS.Security.Library\BASIdentity.cs:line 162
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\MethodCaller.cs:line 221
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\MethodCaller.cs:line 225
at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\MethodCaller.cs:line 149
at Csla.Reflection.LateBoundObject.CallMethod(String method, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\LateBoundObject.cs:line 86
at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\DataPortal\Server\SimpleDataPortal.cs:line 126
at Csla.DataPortal.Fetch(Type objectType, Object criteria) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\DataPortal\Client\DataPortal.cs:line 249
at Csla.DataPortal.Fetch[T](Object criteria) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\DataPortal\Client\DataPortal.cs:line 165
at BAS.Security.Library.BASIdentity.GetIdentity(String username, String password) in C:\Visual Studio 2008\CSLA Framework\BAS\BAS.Security.Library\BASIdentity.cs:line 73
at BAS.Security.Library.BASPrincipal.Login(String username, String password) in C:\Visual Studio 2008\CSLA Framework\BAS\BAS.Security.Library\BASPrincipal.cs:line 32
at BASWin.LoginForm.OK_Click(Object sender, EventArgs e) in C:\Visual Studio 2008\CSLA Framework\BAS\BASWin\LoginForm.cs:line 55
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.PerformClick()
at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at BASWin.MainForm.DoLogin() in C:\Visual Studio 2008\CSLA Framework\BAS\BASWin\MainForm.cs:line 297
at BASWin.MainForm.MainForm_Load(Object sender, EventArgs e) in C:\Visual Studio 2008\CSLA Framework\BAS\BASWin\MainForm.cs:line 63
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at BASWin.Program.Main() in C:\Visual Studio 2008\CSLA Framework\BAS\BASWin\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: Csla.Reflection.CallMethodException
Message="DataPortal_Fetch method call failed"
Source="Csla"
StackTrace:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at BAS.Security.Library.BASIdentity.DataPortal_Fetch(CredentialsCriteria criteria) in C:\Visual Studio 2008\CSLA Framework\BAS\BAS.Security.Library\BASIdentity.cs:line 162
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\MethodCaller.cs:line 221
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\MethodCaller.cs:line 225
at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\MethodCaller.cs:line 149
at Csla.Reflection.LateBoundObject.CallMethod(String method, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\LateBoundObject.cs:line 86
at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\DataPortal\Server\SimpleDataPortal.cs:line 126
InnerException: System.Data.SqlClient.SqlException
Message="An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=20
LineNumber=0
Number=53
Server=""
State=0
StackTrace:
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at BAS.Security.Library.BASIdentity.DataPortal_Fetch(CredentialsCriteria criteria) in C:\Visual Studio 2008\CSLA Framework\BAS\BAS.Security.Library\BASIdentity.cs:line 162
at dm(Object , Object[] )
at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio 2008\CSLA Framework\csla350cs\Csla\Reflection\MethodCaller.cs:line 221
InnerException:
All of the appSettings are commented out as I am using a direct connection (am reading up on Wcf and will utilize that when I understand it a little better).
Can anyone steer me in the right direction. I have a feeling I have to change a db setting somewhere!
Thank you,
Keith
I can connect to it through the Server Explorer though and can drag and drop tables and usp's into the designer.
Keith
You do not need parenthesis around the server name. it should be just ggba001. See if this works.
Thanks sergeyb. That was a big big ahh duhhh on my part. As soon as I read your reply I remembered the () are for a local connection only. There are advantages and disadvantages to being the only developer at a location. The BIG disadvantage is I have to post my ahh duhh's for everyone to see and straighten me out. Thanks again.
Keith
Copyright (c) Marimer LLC