I didn't know where else to put this. I'm only getting this error on one page of my application.
I'm running sql server2000 and 2005 on the same server. The db is sqlserver 2000.
It's driving me nuts...
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)
any help is always welcomed...
On the server concerned, you need to get your DBA to go:
StartAll ProgramsMicrosoft SQl Server 2005Configuration ToolsSql Server Surface Area ConfigurationSurface Area Configuration for Services and ConnectionsSelect server instance (if more than one)Select Database EngineSelect Remote Connections nodeSelect the Local And Remote ConnectionsClick Apply|||
On you server got to:
Start > Programs>SQL Server 2005>Configuration Tools>SQL Server Configuration Manager
then expend the SQL Server 2005 Network Configuration node and it will show all the instance of sql server runing on this machine.
Select your desired instance and make sure that Shared Memory and TCP/IP protocols would be enabled.
|||
why would this connection issue start all of a sudden?
this code has been out for over a month? And why would I be able access the the db a good half dozen times prior to this connection issue?
kg
|||
Somebody might have changed your server configurations :)
|||And why would I be able access the the db a good half dozen times prior to this connection issue
|||Below is my last select statement beofre the connection issue. It goes thru all of the code and populates the values. It seems like this is happening when the postback is happening.
kg
Dim connectionStringAsString = WebConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim conSQLAsNew SqlConnection(connectionString)
Dim sqlStrAsString ="select transition_type, transitioner, convert(char(8),transition_date,112) as transition_date, " _&" agreement_type_code, agreement_status_code, sandt_effort, sandt_code, sort_order, code as ttaCode " _
&" from transition_gp " _&" where program_code = @.programcode and gap_code = @.gapCode " _
&" order by sort_order "
Dim cmdSqlAs SqlCommand =New SqlCommand(sqlStr, conSQL)cmdSql.Parameters.AddWithValue("@.programCode", programCode)
cmdSql.Parameters.AddWithValue("@.gapCode", gapCode)conSQL.Open()
Dim readerAs SqlDataReader = cmdSql.ExecuteReader()DoWhile reader.Read()
transitionType = reader("transition_type").ToStringtransitionDate = reader("transition_date").ToString
transitioner = reader("transitioner").ToStringagreementTypeCode = reader("agreement_type_code").ToString
agreementStatusCode = reader("agreement_status_code").ToStringsantEffort = reader("sandt_effort").ToString
sandtCode = reader("sandt_code").ToStringmaxSort =CInt(reader("sort_order").ToString)
ttaCode = reader("ttaCode").ToString
Loop
reader.Close
cmdSql.Dispose()
conSQL.Close()
No comments:
Post a Comment