BobBarker_99
asked on
Host an SqlServer 2005 Database on WIndows XP
Hello, I have a little program i wrote which connects to a sql databse. Until now I have just been using localhost in the command line. I want to try and get it working so I can run my program from another computer (not on the same network).
Is it possible to do this, if the machine hosting the sql database is Vista Professional?
If it is possible, I must be doing something wron becuase its not working.
I am using the followin connection string:
connectionString="Data Source=123.123.123.123,143 3\SQLEXPRE SS;Initial Catalog=myDB;Integrated Security=True"
I have performed the steps listed here: http://support.microsoft.com/kb/914277
Is it possible to do this, if the machine hosting the sql database is Vista Professional?
If it is possible, I must be doing something wron becuase its not working.
I am using the followin connection string:
connectionString="Data Source=123.123.123.123,143
I have performed the steps listed here: http://support.microsoft.com/kb/914277
port #1433 is default port and dont' need to specify it in connection string
moreover, are you able to connect your SQL Express from other computer out of your network? I am sure it is not configured correctly....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yes, that is what I mentioned in my previous post either go for sql authentication or if it is possible make your ASPNET account trusted (create login) in your SQL express.
I know Ritheshsa, I just wanted to explain how to change the connection string since you didn't explained that. :)
ASKER
Ok, I have modified my connection string, and enabled sql login.
When I use:
Data Source=\LOCALHOST;Initial Catalog=TutoringDB;User ID=myid;Password=mypass it works.
But
Data Source=xxx.xxx.xxx.xxx;Ini tial Catalog=TutoringDB;User ID=myid;Password=mypass
gives me teh following exception:
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
Any ideas?
When I use:
Data Source=\LOCALHOST;Initial Catalog=TutoringDB;User ID=myid;Password=mypass it works.
But
Data Source=xxx.xxx.xxx.xxx;Ini
gives me teh following exception:
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
Any ideas?
ASKER
I tried using tcp instead and got
Network=DBMSSOCN;Data Source=xxx.xxx.xxx.xxx;Ini tial Catalog=TutoringDB;User ID=myid;Password=mypass
(provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"
Network=DBMSSOCN;Data Source=xxx.xxx.xxx.xxx;Ini
(provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"
Maybe there's a firewall blocking any connection to port 1433.
Also make sure SQL Browser agent is enabled
Also make sure SQL Browser agent is enabled
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.