ASP.NET - Connecting to remote SQL Server 2008 database

Asked By Marty Coonrod on 25-Apr-09 06:52 PM

Hope I'm asking this in the right place, forgive if it's not.

I have a data base set up on a remote server. I can connect to it using MSSqlServer Management Studio. I ran the aspnet_regsql and it created the required tables for authentication. So I know that everything works as it should.

My problem is connecting from Visual Studio 2008 SP1. Here is a copy of my connection string(modified of course):

<add name="HRRConnection" connectionString="Data Source=xx.xxx.xx.xxx;Initial Catalog=Riverrats;uid=riverrat;Password=xxxxxxxxxx;" providerName="System.Data.SqlClient"/>

When I run the Asp.Net Configuration to try to setup users and roles I cannot connect. I have tried with 2 different SQL servers on 2 different machines and have the same problem with both.

What the heck am I missing!

Thanks in advance,

Marty

It sounds like you don't have mixed mode authentication enabled

Peter Bromberg replied to Marty Coonrod on 25-Apr-09 07:36 PM
That you need to do on the server. Also, SqlBrowser service usually needs to be running in order to expose your server to outside clients.

Yup, I do.

Marty Coonrod replied to Peter Bromberg on 25-Apr-09 07:42 PM

When I connect using MSSMS I use the user Id and password that is in my connection string to connect.

But I apreciate the input. Any other ideas?

Also the other SQL Server is a ISP

Marty Coonrod replied to Marty Coonrod on 25-Apr-09 07:44 PM

The other data base server is an ISP. I set up my own after I couldn't connect to that one, trouble shooting.

more information
Ravenet Rasaiyah replied to Marty Coonrod on 25-Apr-09 10:05 PM
Hi

can you provide more information error or what you are getting when you are try to access the database

Thank you
check whether the service accounts
Venkat K replied to Marty Coonrod on 25-Apr-09 11:14 PM
are running on the service account which has valid permissions.
2. check whether the remote connection are enabled / not in configuration settings.
3. Check whether you have configured sql server 2008 on any port. (If yes, mention servername,portnumber while connecting.

Still if you have some problem reply the "Error message" so that we can trace what may be the problem.
Santhosh N replied to Marty Coonrod on 26-Apr-09 12:23 AM
Which version of sql server you are using...

If you are using 2008, then it has some issues connecting from VS 2008 ..

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=312633

anyway , I suppose you can try this and check the connection string from this step...

http://weblogs.asp.net/nannettethacker/archive/2008/02/17/creating-a-database-connection-to-a-remote-sql-server-database-within-visual-web-developer.aspx
see whether you have followed all the steps
H K replied to Marty Coonrod on 26-Apr-09 11:31 AM
refer to the below link to see whether you have followed all the steps related to setting up users and roles for the authentication module supported by vs.net

http://webhelp.esri.com/arcgisserver/9.3/dotNET/index.htm#users_roles_sql_server.htm

Figured it out
Marty Coonrod replied to H K on 27-Apr-09 09:36 PM

OK, after looking way to deep into the problem I finally took a step back and took a different approach. Why I didn't work with the connect to server wizard I have no clue, maybe I don't understand what it's for.

What I did was started the SqlServer Configuration manager and added the server as a new alias then used the connect to database wizard. Probably just my inexperience.

Thanks for all the suggestions.