.NETGURU
Can't connect to remote SQLServer FROM .NET?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngdata' list.


Dave Notik
-- Moved from [aspngfreeforall] to [aspngdata] by Yannick Smits <Click here to reveal e-mail address> --

Hi all:

I have a really pressing issue we've been struggling with here. We have a
.NET application. It connects to a database on OurPC1. When the application
itself is running on OurPC1, it connects to the SQLServer just fine. However
if we run a build of the same application on OurPC2, it cannot connect find
SQLServer on OurPC1. We get this error:

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

We use the following connection string:

server=OurPC1;uid=sa;pwd=slmk;database=Aurora

Again, it works when the application is on OurPC1, but now when its on
OurPC2.

I AM able to access the database on OurPC1 using the above connection
details from Enterprise Manager and Query Analyzer and such, so it seems to
be an issue w/ .NET itself. Also, I AM able to access a remote server like
sql.digital202.com.

Has anyone experienced this issue? Please help!

Thank you so much in advance.

-Dave

Reply to this message...
 
    
Tim Curtin
try the IP of the machine...

[Original message clipped]

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

Reply to this message...
 
    
Liz

your connection string is indicated as "OurPC1" when you say you want
"OurPC2" ... ?? ... is "sa/slmk" valid on OurPC2 ? have you tried the IP
address instead of "OurPC2" ? you haven't indicated whether you are using
the SqlConnection class or the OleDbConnection class ... whichever, try the
other one ... have you tried to connect to OurPC2 using EM from the machine
that the ASPX file is located on ? or are you using EM from another machine
?

"Dave Notik" <Click here to reveal e-mail address> wrote in message news:681220@aspngdata...
[Original message clipped]

Reply to this message...
 
    
John R. O'Brien
Does the machine ping by name? If not, try the ip as suggested before.

Does the sql server PC1 have tcp/ip sockets enabled for listening? This
is default during install, check the server network utility in the sql
server program group to see what is enabled on the server. If not
enable tcp/ip.

Is the server security set to mixed mode? If not, enable the mixed
mode, check this from the EM properties of the sql server pc1 security
tab.

Is it still unable to connect?

John R. O'Brien
Home 410 352 3614
Cell 443 497 2017
FAX 801 849 7589

-----Original Message-----
From: Tim Curtin [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 7:03 PM
To: aspngdata
Subject: [aspngdata] Re: Can't connect to remote SQLServer FROM .NET?

try the IP of the machine...

[Original message clipped]

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Mike Campbell
Another nice tool to help you debug this issue is the use of a *.udl.

Right click on your desktop, select new>text document
Change the extension of the document to .udl (you'll need to have the
view file extensions for know file types checked (windows
explorer>tools> folder options > view))

Then, just zip through to the first tab of the new .udl document and
configure the connection as needed and test it...

If you've verified that pc1 is listening on TCP/IP and that your
authentication method is correct, you may need to install a later
version of MDAC on pc2 (a quick way to do this is to just pop in your
sqlserver2k disk and install just the client connection tools... This
will ensure that the client machine can connect to the server -- I've
actually run into this problem before).

HTH,

--Mike

-----Original Message-----
From: John R. O'Brien [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 6:00 PM
To: aspngdata
Subject: [aspngdata] Re: Can't connect to remote SQLServer FROM .NET?

Does the machine ping by name? If not, try the ip as suggested before.

Does the sql server PC1 have tcp/ip sockets enabled for listening? This
is default during install, check the server network utility in the sql
server program group to see what is enabled on the server. If not
enable tcp/ip.

Is the server security set to mixed mode? If not, enable the mixed
mode, check this from the EM properties of the sql server pc1 security
tab.

Is it still unable to connect?

John R. O'Brien
Home 410 352 3614
Cell 443 497 2017
FAX 801 849 7589

-----Original Message-----
From: Tim Curtin [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 7:03 PM
To: aspngdata
Subject: [aspngdata] Re: Can't connect to remote SQLServer FROM .NET?

try the IP of the machine...

[Original message clipped]

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngdata] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngdata.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

-

-

Reply to this message...
 
 
System.Data.OleDb.OleDbConnection
System.Data.SqlClient.SqlConnection




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification