小新二三事 二三事 電視精/戲院 ASP .NET 新手工作日誌

2009年7月17日星期五

ASP.NET Code: www.qsh.eu ConnectionString

ASP.NET Code: www.qsh.eu ConnectionString
For examle you have database "Test.mdf" created at SQL Server Management Studio Express.

1st step: your database must be detached from your SQL server correctly: open management studio -> right click on "Test" database -> Tasks -> Detach.

2nd step: create folder www/App_Data and copy Test.mdf without log file.

3 step: generate connection string at https://www.qsh.eu/admin/EditFreehosting.aspx and save in web.config.

4 step: replace name="LocalSqlServer" with (for example) name="DBAccess".

5 step: in code you can read connection string from web.config:

string connectionString = ConfigurationManager.ConnectionStrings["DBAccess"].ConnectionString;
IDbConnection connection = new SqlConnection(connectionString);
OR
replace name="DBAccess" with (for example) name="LocalSqlServer" in all ASPX
the stupid method i did once...

Login Link for www.qsh.eu
https://www.qsh.eu/admin/Login.aspx

免費asp.net空間(www.qsh.eu)使用詳解
http://www.0379zd.com/news/show/17001.htm

Qantasoft qsh.eu webconfig connectionString problem
http://forums.asp.net/p/1253493/2356606.aspx#2356606

沒有留言: