Can't open a SqlConnection

M

Mark

Hello again....

I have just started with .net and ado.net and am tryng to get a
SqlConnection working.

I know my MSDE is working as I am able to retrieve data from it using an ado
connection and an ado recordset.

When I try to use a SqlConnection I get the following error on the cn.Open
line

"Unhandled exception: system.data.sqlclient.sqlexception: SQL Server does
not exist or access denied"

I am using the same connection details in both methods (string formats are
different ofcourse :mad:) but the SqlConnection method fails every time. I even
went so far as to join all the user accounts on my test box to the
administrators group. Still no joy :eek:(

Any help greatly appreciated

Mark
 
M

Michael McCarthy

Mark said:
Hello again....

I have just started with .net and ado.net and am tryng to get a
SqlConnection working.

Any code examples, it seems pretty straight forward that something isn't
right, in that whatever it thinks it is connecting to is not actually
the correct path to the database.
 
M

Mark

Any code examples, it seems pretty straight forward that something isn't
right, in that whatever it thinks it is connecting to is not actually the
correct path to the database.

Michael... You are I suspect, correct :mad:) I'm not sure what was wrong or how
I fixed it but it sort of works now...

Thanks

Mark
 
T

TC

It will be authentication. When you access the data via vis studio you are
using your credentials. When you do it via the running app you are using
ASPNET user credentials unless you are impersonating.

TC
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top