sql database connection on remote server
i create my web site on asp.net and i create database in sql using inbuilt it in visual studio i use step to create database 1.right click on solution explorer then add newSqldatabase then ok then if i connect it by coding then it will work on my local PC but actuall i am making website so i want to store it on my web server then if i load databse file (.mdf) file in my web server where my all files are loaded then it is showing it error "A开发者_如何学编程 network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)" so please help me and send me all step how i create database and what coding i use to connect on remote server....... Thank You......
You'll want to look up connection strings to become familiar with the format of them, then it's basically a case of making sure your parameters are correct.
Check out http://www.connectionstrings.com/sql-server-2005.
The connection strings are typically stored in web.config. Some examples are here:
http://weblogs.asp.net/owscott/archive/2005/08/26/Using-connection-strings-from-web.config-in-ASP.NET-v2.0.aspx
精彩评论