db connection works on local but not on webserver

S

Steve

I'm trying to get some data out of SQLServer on our
Webserver.
I built the database on my local machine and the code
pages are on my C: drive and the virtual folders are in
IIS running on my local machine.

The following connection string works fine (TRHXP210 is
my maching name):-

Private Const m_strConnection As String
= "Password=;Persist Security Info=True;" & _
"User
ID=sa;Initial Catalog=Committee;" & _
"Data
Source=TRHXP210;" & _
"Network
Library=dbmssocn"

The problem is if I try to connect to an SQL db on our
webserver I get the following Error:-
System.Data.SqlClient.SqlException: SQL Server does not
exist or access denied.

The code files are on my local machine - could it be that
I have to build everything locally then disconnect the
database, deploy the app on the server, then re-attach
the db on the remote instance of SQLServer?
Should I be able to pull data from the remote server? It
works with my ASP pages!??
Can anyone help please.
TIA
 
K

KrisK

Steve:

this is my connection string and it is working:
"data
source=ip_or_url_of_the_server_with_myDb;database=MyDB;..."

I am using SQLServer ADO.NET dedicated driver (not OLEDB
etc)

Hope it works.

KK
 

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