Problems with ASP.NET accesing a remote SQL database

H

Hrvoje Vrbanc

Hello all!

Scenario:
- web server at one location (domain) with VS 2003
- SQL server at a remote location (domain)
- VPN connection on port 1433 between the two domains

I have no troubles reaching the remote SQL server either from SQL Enterprise
manager or in VS 2003 design-time (using the SQL authentication in both
cases) - all the connections work and I can preview data while building
ASP.NET application.

However, ASP.NET pages at run-time cannot display data from remote database:

"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.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not
exist or access denied."

What should I do in order to be able to display those data?
Thank you in advance,
Hrvoje
 
M

Munawar Hussain

Would you let me see you connectionstring

just like ... CSTring=datasource<any>;passwprd=<any>

because the situation you are telling.. there is no clear reason for
connection to be denied..

If you are creating connection from some wizard then ... you need to add
password to connectionstring manualy because wizzard dont add password....

Looking for details..

regards
Munawar
 
H

Hrvoje Vrbanc

Hello!

I prefer to set my connections manually, so the string is set up like this:

dim con as new sql connection("server=server_name; database=database_name;
user id=sa; password=pwd")

I'm most puzzled because I can access data in design-time preview, I also
have full functionality in SQL Enterprise Manager but ASP runtime is having
problems.

Also, telnetting to remote SQL server to port 1433 works fine.
 
G

Guest

Like Munawar Said,
Check your connection string. I just drag sql table from the visual studio
server explorer onto a page and let visual studio do the rest, create the
string, etc. A little cut and paste and your rolling hopefully it works for
VPN connections I can't test this on my setup so...

Good Luck
DWS
 

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,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top