Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Can't open a SqlConnection

Reply
Thread Tools

Can't open a SqlConnection

 
 
Mark
Guest
Posts: n/a
 
      05-09-2005
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 :@) 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 (

Any help greatly appreciated

Mark


 
Reply With Quote
 
 
 
 
Michael McCarthy
Guest
Posts: n/a
 
      05-12-2005
Mark wrote:
> 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.
 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      05-12-2005
> 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 :@) I'm not sure what was wrong or how
I fixed it but it sort of works now...

Thanks

Mark


 
Reply With Quote
 
TC
Guest
Posts: n/a
 
      07-19-2005
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


"Mark" <(E-Mail Removed)> wrote in message
news:XTPge.2129$(E-Mail Removed)...
>> 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 :@) I'm not sure what was wrong or
> how I fixed it but it sort of works now...
>
> Thanks
>
> Mark
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to get SQLConnection to Open() in BackgroundWorker =?Utf-8?B?VE9NX1Bhc2FkZW5h?= ASP .Net 9 01-27-2007 07:32 PM
SqlConnection Object in Application Variable OR Session Variable OR open/close pratham ASP .Net 3 08-31-2006 07:26 PM
"Timeout expired" when calling SqlConnection.Open() Nils Magnus Englund ASP .Net 2 08-24-2005 08:12 AM
SQLConnection.Open() Timeout Error - but...nothing has changed? Nevyn Twyll ASP .Net 4 03-19-2005 01:38 AM
Re: SqlConnection.Open() permission denied for remote sql server Kevin Spencer ASP .Net 3 08-15-2003 06:26 PM



Advertisments