URGENT- Unable to connect to the SQL Server

  • Thread starter Zalak Dedhia via DotNetMonster.com
  • Start date
Z

Zalak Dedhia via DotNetMonster.com

Hello Guys,

I need some help urgently regarding the code to connect to the SQl Server
on a remote machine and possible configurations to make, or chanegs in the
connection string or so.

I mean i keep getting the error "SQL Server or Access denied"

To rectify this i have used 'n' number of diff combinations of the
conenction string with the SQLConnection methos, please let me know if they
are correct or if there is something that needs to be added

The various connection strings tried:-

myConnectionString = "Initial Catalog=Northwind;Data Source=\\
blrkec25251;Integrated Security=SSPI;"

myConnectionString = "Persist Security Info=False;Integrated
Security=SSPI;database=northwind;server=MSSQLSERVER;data
source=blrkec25251;user ID=zalak;pwd=dedhia"

myConnectionString = "User ID=zalak;pwd=dedhia;Initial
Catalog=Northwind;Data Source=MSSQLSERVER;Workstation ID=blrkec25251"

myConnectionString = "data source=blrkec25251;initial
catalog=Northwind;uid=sa;pwd=SysAdmin"


myConnectionString =
"uid=sa;pwd=SysAdmin;database=Northwind;server=192.168.206.97"

I need to know what exactly to out the value for each of these parameters
needs to be

SERVER
INITIAL CATALOG
Data Source
Workstation Id


thanks and regards,
zalak
 
G

Guest

Hi,

You probably will have to check with system administrator to get the
server name if it is wrong but one of these 2 should work. Integrated
Security = sspi means it uses your windows login to verify you have access to
sql server. Data source and server are the name of the sql server. Data
source = server only need to specify one not both. Initial catalog is the
database name. Can use database or initial catalog. Workstation id is the
name of the computer connecting to the sql server.

myConnectionString = "database=northwind;data source=blrkec25251;user
ID=zalak;pwd=dedhia"

or

myConnectionString = "Integrated Security=SSPI;database=northwind; data
source=blrkec25251;"

http://msdn.microsoft.com/library/d...ntsqlconnectionclassconnectionstringtopic.asp

Ken
 
Z

Zalak Dedhia via DotNetMonster.com

Thanks Ken Tucker.

I got a good insight into the various parameters but have not yet tried to
deal with the problem. Shall let you know if i could solve it!!

Thanks again,
Zalak
 
Z

Zalak Dedhia via DotNetMonster.com

Thanks Locke

Will try to use this and let you know if any other queries arise.

Thanks again,
Zalak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top