Monday, March 12, 2012

im going crazy

I just got bought a used computer, and Im trying to change the server name, I've changed the computer name and restarted the computer, I've also used query analyser and changed the server name, but when I try run an c# appication that connects to a sql database I get a server does not exist/access denied error message.

when I go to enterprise manager and server service manager the server name still comes up as PICARD\HOMESQL

obvuiusly I cant use a "\" in the connection string of my windows application.

does anybody know how I can change the server name to PETER.

thanks in advance

What is your actual connection string ? Make sure that you either have to @.Qoute your string or escape your string to allow the backslash. If the names server is on another port than the default one and SQL Server is not started you have to name the port after the name Servername\Instance,Port

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Thanks for your reply. This is my connection string:

namespace BankAccounts

{

[Transaction(TransactionOption.Required), ObjectPooling(MinPoolSize =1,

MaxPoolSize =5),

JustInTimeActivation(true), SecurityRole("Authorized Users", false),

ConstructionEnabled(Default =

"server=MARCUS; database=Northwind; integrated security=sspi;")]

in enterprise manager the server name is MARCUS\HOMESQL

but using this server name gives the same error.

|||Hi,

try using

"server=MARCUS\\HomeSQL; database=Northwind; integrated security=sspi;")] OR
@."server=MARCUS\\HomeSQL;; database=Northwind; integrated security=sspi;")]

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Thank you very much. My application work fine now. I see what the problem with my connection string was now.

again thank you very much.

learn something new everyday.

|||

BTW,

when I use server=local host as part of my connection string, why didnt it work?

|||OK, I don′t know how aware you are of the concept, so heres the concept in a short abstract:

The name SQL Server is sort of misleading, because its a Server service rather than a "server". Every SQL "Server" is instance, a default one or a named instance, which is, if you use TCP/IP bound to a port. THe keyword "Server" or "Data Source" points to a Service or an instance name, not the physical server name. For default instance it is the server name, for named instance the servername + the \Instancename. If you don′t have SQL Browser started, you have to specify the port for the connection. If SQL Browser is started it can redirect the request of the client to the appropiate port where the service is bound to.

Hope I made that a bit clearer.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||

airwalker2000 wrote:

BTW,

when I use server=local host as part of my connection string, why didnt it work?

should be (local) or (local)\instancename or (.) or (.)\instancename

or mypcname or mypcname\instancename

localhost is an IIS reserve word

(local) or (.) is for Sql server

|||Thanks joeydj....that really helped, much appreciated

No comments:

Post a Comment