請大俠幫忙查錯!(汗,自己改了改了一下午了!還是沒有改好!_
<script runat="server" language="vb">sub page_load(obj as object,e as Eventargs)
dim conn as OleDbConnection
dim rs as OledbCommand
dim oc as OledbDataReader
conn = new OleDbCOnnection("Provider = Microsoft.Jet.OleDb.4.0;data source="& server.MapPath("data/liyong.mdb"))
conn.open()
rs = new OleDbCommand("select count(*) from [User] where name='123'",conn)
rs.Connection.Open()
dim i as integer
i=rs.ExecuteScalar()
rs.Connection.Close()
label2.textl = i
if i > 0 then
label1.text = "你的用戶名被別人用了"
else
label1.text = "用戶名可用"
end if
conn.Close()
end sub
</script>
只是判斷一下看有多少個用這個名子的人,並顯示也數字!