asp技術訪問資料庫的過程

2022-04-02 15:20:20 字數 925 閱讀 9058

1樓:林寒鬆考濃

首先要設定iss的權力和asp訪問的是什麼型別的資料庫,讓iss擁有修改資料的許可權和資料庫的種類.然後在asp**中插入sql語言就可以了.

2樓:赫耘豪線歆

介紹哈asp.net吧!

1.要開啟sql伺服器,將資料庫檔案匯入到資料中2.編寫訪問資料的配置檔案

3.編寫訪問資料庫的類

4.用對應的型別儲存讀取資料庫中的資訊

5.顯示在頁面

3樓:脫莉莉幹紹

拿sql

server為例:

裝iis

設定訪問資料庫的驗證方式

要設定為windows驗證和使用者密碼驗證

c#中**:

sqlconnection

conn

=new

sqlconnection('local',user,passwd

="你的密碼",database

="資料庫名稱")

conn.open();

//以上是連結過程

如果要想顯示資料,最好寫一個方法,傳遞一個引數gridviewgrid

然後sqlcommand

cmm=

conn.createcommand();

cmm.commandtext

="你的select語句";

sqldatareader

myread

=cmm.excutereader();

grid.datasource

=myread;

grid.databind();

//更新操作:

cmm.commtext

="你的更新語句";

cmm.excutenonquery();

asp 寫入資料庫的問題,asp 資料庫問題

name trim name if len name 0 then name為空!email trim email if len email 0 then email為空!city trim city if len city 0 then city為空!message trim message if...

asp資料庫連線問題,asp資料庫連線問題

貼那麼多 幹嘛,不說重點 有無出錯提示?有的話,是第幾行?那一行 是哪句?if password rs password then 當你open時查詢記錄為空時,再下面這條判斷密碼的if不成立,則會出錯。中間要加個if rs.eof false and rs.bof false then 把你的連線...

asp寫入資料庫時出現問題

哈哈,你這個沒的判斷語句,是不是經常插入些空白記錄到資料庫中?加 if request.form ti and request.form name and request.form nai then set rl server.createobject adodb.recordset sql sel...