Hi Experts,
When my connection.open() is excuted, i got this error. i am using .NET 2.0 to connect to a database in SQL2005. Kindly Advice! Many thanks!!!!
System.Data.SqlClient.SqlException was unhandled
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(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)
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 ClientEdition.FrmMainApp.isVisitor(String nric) in C:\Projects\SOS\App\ClientEdition\ClientEdition\FrmMainApp.cs:line 91
at ClientEdition.FrmMainApp.CheckPassport(String nric) in C:\Projects\SOS\App\ClientEdition\ClientEdition\FrmMainApp.cs:line 56
at ClientEdition.FrmMainApp.btnRegister_Click(Object sender, EventArgs e) in C:\Projects\SecurityOperatingSystem\App\ClientEdition\ClientEdition\FrmMainApp.cs:line 27
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.Application.Run(Form mainForm)
at ClientEdition.Program.Main() in C:\Projects\SOS\App\ClientEdition\ClientEdition\Program.cs:line 17
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()
When my connection.open() is excuted, i got this error. i am using .NET 2.0 to connect to a database in SQL2005. Kindly Advice! Many thanks!!!!
System.Data.SqlClient.SqlException was unhandled
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.SqlInternalConnect
at System.Data.SqlClient.TdsParser.ThrowExc
at System.Data.SqlClient.TdsParser.Connect(
at System.Data.SqlClient.SqlInternalConnect
at System.Data.SqlClient.SqlInternalConnect
at System.Data.SqlClient.SqlConnectionFacto
at System.Data.ProviderBase.DbConnectionFac
at System.Data.ProviderBase.DbConnectionPoo
at System.Data.ProviderBase.DbConnectionPoo
at System.Data.ProviderBase.DbConnectionPoo
at System.Data.ProviderBase.DbConnectionFac
at System.Data.ProviderBase.DbConnectionClo
at System.Data.SqlClient.SqlConnection.Open
at ClientEdition.FrmMainApp.isVisitor(Strin
at ClientEdition.FrmMainApp.CheckPassport(S
at ClientEdition.FrmMainApp.btnRegister_Cli
at System.Windows.Forms.Control.OnClick(Eve
at System.Windows.Forms.Button.OnClick(Even
at System.Windows.Forms.Button.PerformClick
at System.Windows.Forms.Form.ProcessDialogK
at System.Windows.Forms.TextBoxBase.Process
at System.Windows.Forms.Control.PreProcessM
at System.Windows.Forms.Control.PreProcessC
at System.Windows.Forms.Application.ThreadC
at System.Windows.Forms.Application.ThreadC
at System.Windows.Forms.Application.Compone
at System.Windows.Forms.Application.ThreadC
at System.Windows.Forms.Application.ThreadC
at System.Windows.Forms.Application.Run(For
at ClientEdition.Program.Main() in C:\Projects\SOS\App\ClientEdition\Client
at System.AppDomain.nExecuteAssembly(Assemb
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.Ho
at System.Threading.ThreadHelper.ThreadStar
at System.Threading.ExecutionContext.Run(Ex
at System.Threading.ThreadHelper.ThreadStar

Error Connecting to Database
SSIS - newbie
hi darren.simcc
can u please post the connection string which u r using...
and also make sure that u are authorized to use Sql Server
GabrielMartin
WienerSchnitzel
SQL Server 2005 Developer edition disables Remote Connections by default. You can enable it using SQL Server Surface Area Configuration (SSAC) tool. Follow these steps:
1. Launch SSAC from Programs/Microsoft SQL Server 2005/Configuration Tools/SQL Server Surface Area Configuration
2. Click on "Surface Area Configuration for Services and Connections"
3. On the left hand side treeview, under "Database Engine", select "Remote Connections"
4. Choose "Local and remote connections" on the pane on right side.
5. Press OK.
No try your code again.
elledibbi
BUG: Named pipes do not work when workerprocess runs under ASPNET account
http://support.microsoft.com/default.aspx scid=kb;en-us;Q315159
Check that you are able to use TCP/IP connections instead