Farmer
Farmer

Reputation: 11003

Connect to remote SQL Server 2008 on Visual Studio 2010

I created a local MSSQL database with my ASP.NET project.

Now I want to connect to my database hosted in www.abc.com

What should I put in the connectionString ?

Upvotes: 0

Views: 6924

Answers (4)

Karthik
Karthik

Reputation: 2399

 "Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;UserId=Your_Username;Password=Your_Password;"

or

 "Data Source=Your_Server_Name;Initial Catalog= Your_Database_Name;integrated security=true"

Upvotes: 0

KV Prajapati
KV Prajapati

Reputation: 94653

You may use Server Explorer tool of Visual studio to get the connection string. (Right click on Data Connections + Add Connection).

Upvotes: 0

Curtis
Curtis

Reputation: 103388

Check with your hosting provider (abc.com). Some hosting providers don't allow remote connection to their databases, and require you to use their web application to access your database.

If they do allow access, they should provide you with SQL Authentication details of:

  • Server Name
  • Database Name
  • Username
  • Password

An example of a SQL connection string would be:

Data Source={server name/ip};Initial Catalog={database name};User ID={username};password={password}; MultipleActiveResultSets=True;

Upvotes: 1

Related Questions