简体   繁体   中英

How to configure my web.config before publishing my web site?

I have published my website to my domain name from Visual Studio...

For that I have modified my Web.Config file like this:

<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="Data Source=mssql001.hosting.combell.com;Initial Catalog=aspnetdb;User Id=MyUserId;Password=MyPassword" providerName="System.Data.SqlClient" />
<add name="TennisOnlineContext" connectionString="Data Source=|DataDirectory|Tennis.sdf" providerName="System.Data.SqlServerCe.4.0 " />

When I'm trying to navigate it in my Web Browser I get the following error:

Cannot open database "aspnetdb" requested by the login. The login failed. Login failed for user 'MyUserId'.

I'm using "Combell" business that supports SQL Server 2008... I have contacted the support online and the username and password seem corrects ;)

Can you tell me what is wrong with my connection string please ? Thanks in advance

Not sure, but are remote connections allowed in your SQL Server instance?

Check this page to see how: http://forums.asp.net/t/1338911.aspx/1

or this: http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

Combell会将数据库名称设置为与用户名相同的值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM