Cannot connect to SQL Server

Z

zenedenzidane

I am not connecting to my sql server running local.programming in
VB.net Database programming with statement
Dim OConn As New SqlConnection("Data
Source=localhost\\KIRZAD-APPLE;Initial Catalog=Northwind;
UID=sa;PWD=")

My server name is KIRZAD-APPLE

OConn.Open() 'Throwing exception,probably not getting the server.

Please help me.Bye.
 
W

William Ryan eMVP

It'd help if you told us what the exception was, but I can guess what it
is. Take off the localhost\\KIRZAD-APPLE and replace it with KIRZAD-APPLE
or the instance name. Just using the Instance name should be enough.

Another thing. Do yourself a favor and either put a password on the SA
account, or better yet, get rid of the SA account and make one of your own
with the privileges you need. Give it a strong password and change the
password on a regular basis, plus anytime an employee leaves or is fired
that may have known what it was. Hackers will target SA and if you don't
have a password on it, you are giving them the keys to the kingdom. This is
such a well known exploit you are really putting yourself at unnecessary
risk for no benefit. While putting a password on it, particularly a strong
one will help minimize this risk, getting rid of SA all together. I know
you need help connecting and not a lecture on security practices, but I
think my first comment will fix the first problem and whether or not you
take my advice about SA, I figured I'd at least mention it in case you
weren't aware of the vulnerability.

Let me know if that doesn't fix the problem.

Bill

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
zenedenzidane said:
I am not connecting to my sql server running local.programming in
VB.net Database programming with statement
Dim OConn As New SqlConnection("Data
Source=localhost\\KIRZAD-APPLE;Initial Catalog=Northwind;
UID=sa;PWD=")

My server name is KIRZAD-APPLE

OConn.Open() 'Throwing exception,probably not getting the server.

Please help me.Bye.
 
Z

zenedenzidane

Thanks for tell me about hacking,I have tried the connection with
string
Dim OConn As New SqlConnection("Data Source=KIRZAD-APPLE;Initial
Catalog=Northwind; UID=sa;PWD=")

But still
OConn.Open() 'An unhandled exception of type
'System.Data.SqlClient.SqlException' occurred in system.data.dll

probably not matching the User id & PWD.Can any one tell me how to
change the SQL databse password,and also what is the syntex of actual
string in Sqlconnection. Bye.
 

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