Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error Connecting to Named Instance


Error Connecting to Named Instance

Author
Message
sgaffney
sgaffney
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 4
I had to install a new instance of SQL Server 2008 R2 Express on Windows 2007 because our SQL Server 2008 R2 Trial version ended (It's just a development machine). I was able to connect to the Express version using SSMS using the machine name\instance name but couldn't connect using the web config from our web service (error establishing connection to SQL Server - error 40). Everything is local. I did read that you if you have a named instance, it connects with dynamic ports but I wasn't sure if this was true when everything is local but I did try changing the port to a fixed one and opened the windows firewall but it still didn't work. So I then changed the port to the default port of 1433 and it did work. So three questions: 1) does that mean I didn't open the firewall correctly when I had another port (I used 1435, which didn't seem to be in use by other program)? 2) In using 1433, it complained that the database name was incorrect and it mentioned the old database name that we used to call that database. But I changed our current database name to that old name and all worked fine. Not sure why/how it found/used that old name? 3) Any issue leaving it as the default port at 1433 when it is a named instance? Does it matter? Thank you!
Superdoc
Superdoc
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 814
Hi,

This could have more than few speculations, usually it is necessary to have sql browser service to be running if you're using named instance if you hadn't uninstalled previous default instance, and since you used custom port, did you happen to configure that port for the instance in the connection string?

Regards,
sgaffney
sgaffney
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 4
Hi, yes, I did add the port number to the connection string in the web.config in the format of machine\instance,port (in the same format as I connected via SSMS) and I did update the configuration for the instance in the SQL Server Configuration Manager adding the port. But it didn't work. But once I added the default port (1433) to the instance in the SQL Server Configuration Manager it did work. I had tried the Browser Service as well but couldn't get that to work so that's when I tried just tried using the default port of 1433. I think some how even though I updated my firewall it just didn't work somehow. And everything is local so I wouldn't think that I would need to update the ports but I did. Also the weird thing is that when using the default port, it uses our old database name. Thank you.
sgaffney
sgaffney
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 4
Fixed, I had a typo in the port assignment.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search