Click here to Skip to main content
15,887,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
is it possible to connect ASP.NET web application (which is on the server) with loaclhost MSSQL database (run in Windows Management Studio 2008 R2)? What should be the connection string? Thanks
Posted
Comments
[no name] 4-Jul-14 9:59am    
www.connectionstrings.com

1 solution

Let me first understand what is your exact requirement?

ASP.NET app is in web server.
SQL Server is in the same server.

You can connect using sql server instance installed in the server.

Standard Security
C#
Server=myServerAddress;Database=myDataBase;User Id=myUsername;
Password=myPassword;


Trusted Connection
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

using Sql Server Instance
C#
Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;
Password=myPassword;



Now, if your sql server exists in a different server
Connect using IP address

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;
Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;


Now, if your sql server exists in your machine -
the scenario to connect is absurd

Hope this helps!
Cheers
 
Share this answer
 
Comments
vezo11 7-Jul-14 8:30am    
Database is in my computer. Is not absurd, its only for test.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900