ASP中怎麼實現從資料庫中讀出資料到下拉框中

2022-03-09 05:05:50 字數 752 閱讀 3153

1樓:匿名使用者

<%sql="select * from 表名 where 條件"

rs.open sql,conn,1,1

if rs.bof and rs.eof then%>

暫無內容

<%else

%>請選擇<%

do while not rs.eof

%>"><%=rs("欄位")%>

<%rs.movenext

loop

end if

%>

2樓:匿名使用者

例如:<%

sql="select name from tb_user"

rs.open sql,con,1,1

if not rs.eof then

do while not rs.eof

%>"><%=rs("name")%>

<

con.execute sql

rs.movenext

loop

end if

rs.close

%>可以照這個意思改一下。

3樓:匿名使用者

就是樓上這個意思,但是有一點補充,應該先是新增到資料庫裡面吧,然後下拉框是讀取資料庫,資料庫裡面新增了,下拉框就自動就有了,我理解你可能是這個意思吧

c如何讀出資料庫中的資料型別為數字

看你使用的是何種資料庫.如果是sql server,那麼使用sqlldataconnection,sqldatacommand,sqldatareader來獲取資料庫的資料.sqlconnection sqlcon new sqlconnection 連線字串 sqlcommand sqlcmd n...

怎樣讓asp與sql資料庫連線實現登陸並跳轉到另一

在這個幾點中新增,我這個是經過機密了的連線串。在vs裡面選單欄,檢視 伺服器資源管理器 資料連線 處右鍵新增連線。根據提示填寫伺服器ip 資料庫名 使用者名稱 密碼。新增完成之後點選一下測試按鈕。前面的資訊填寫正確後回提示測試成功。點選確定講出現如下連線列表。至於web.connfig配置檔案中的連...

在oracle資料庫中如果查詢資料庫中有哪幾張表

分兩種情況,一種是查詢當前使用者下的表,另一種是查詢當前資料庫下所有的表。查詢當前使用者的表 select table name from user tables 查詢當前資料庫下所有的表 select from user tables 查詢當前使用者的表 select from all table...