1樓:匿名使用者
直接把。config的ip改成伺服器ip,使用者與密碼要改一下把。
然後覆蓋到伺服器上就ok
asp.net中如何配置web.config檔案鏈結sql資料庫(流汗!)
2樓:網友
呼叫資料連線兩種方法 (配置檔案) 中。
呼叫的時候。
string strconn = "connectionstring"].tostring();
sqlconnection conn = new sqlconnection(strconn);
2.或者不用直接在檔案中寫。
sqlconnection conn = new sqlconnection("server=.\sqlexpress;uid=sa;pwd=123456;database=login");
如何是express版的資料庫,一定要在伺服器名的後面加上 \\ssqlexpress
乙個完整的例子。
string username = "username"];
string userpwd = "userpwd"];
sqlconnection con = new sqlconnection("server=localhost\\sqlexpress;uid=sa;pwd=123456;database=login");
sqlcommand cmd=new sqlcommand("select count(*)from login where username='"username+"'and userpwd='"userpwd+"'con);
int count=
if(count>0)
asp.net中如何用web.config檔案來連線sql資料庫?
3樓:網友
只能存放連線用的字串,不能對資料庫進行連線,主要是存一些配置資料和經常修改的資料。
完整的web.config配置sql資料庫,我要.net方面c#的
4樓:匿名使用者
一般都把鏈結字串放絕銀冊進去。
放並巨集在外面configuration裡面。
呼叫搏謹。名稱空間using ;
sqlconnection conn=new sqlconnection();
connstr"];
C中怎麼把sql資料庫的資料賦值給變數
連線資料庫,並從資料庫中讀取資料後並輸出 using system using system.collections.generic using system.linq using system.text using system.data.sqlclient namespace login nam...
sql資料庫如何把null轉化為空字元
sqlserver中可用isnull函式 select isnull null,oracle中可用nvl函式 select nvl null,from dual mysql中可用ifnull函式 select ifnull null,不能set為 的話 那你是要把int型別 轉換為varchar 型...
安裝資料庫的問題(SQL 2000) 30
安裝資料庫的問題 sql .可能是以前安裝的mssql沒刪除乾淨,建議徹底刪除後再重新安裝。.和.都是由於你的錯誤安裝引起的。你可以新建乙個例項試試,資料庫應該可以用,但是和其他軟體引起的衝突就很難解決了,最好刪掉所有這些報錯的軟體,再重灌一遍。補充的問題,,可能是你使用了windows使用者的驗證方...