练习写了一段登陆验证的代码,可是label1和label2总是一点反应都没有,label1是想要根据情况出现一段不同的字,而label2则是出现一段超链接,出现的结果是什么都不显示
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objconnection As New OleDbConnection
Dim strpath As String, strid As String, strpsw As String
strid = Request.Form("txtid")
strpsw = Request.Form("txtspw")
strpath = Server.MapPath("web.mdb")
Call dbconnection(objconnection, strpath)
Dim strSql = "select * from id where strid= " & strid
Dim objAdap As New OleDbDataAdapter(strSql, objconnection)
Dim objDSet As New DataSet
label2.Text="<a href="index.asp">返回上页</a>"
objAdap.Fill(objDSet, "user")
If objDSet.Tables("user").MinimumCapacity = 0 Then
Label1.Text = "没有该用户"
Else
If objDSet.Tables("user").Rows(0)("strpassword") <> strpsw Then
Label1.Text = "密码不正确"
Else
Label1.Text = "登陆成功"
Session("strid") = strid
End If
End If
objconnection.Close()
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objconnection As New OleDbConnection
Dim strpath As String, strid As String, strpsw As String
strid = Request.Form("txtid")
strpsw = Request.Form("txtspw")
strpath = Server.MapPath("web.mdb")
Call dbconnection(objconnection, strpath)
Dim strSql = "select * from id where strid= " & strid
Dim objAdap As New OleDbDataAdapter(strSql, objconnection)
Dim objDSet As New DataSet
label2.Text="<a href="index.asp">返回上页</a>"
objAdap.Fill(objDSet, "user")
If objDSet.Tables("user").MinimumCapacity = 0 Then
Label1.Text = "没有该用户"
Else
If objDSet.Tables("user").Rows(0)("strpassword") <> strpsw Then
Label1.Text = "密码不正确"
Else
Label1.Text = "登陆成功"
Session("strid") = strid
End If
End If
objconnection.Close()
End Sub
解决方案 »
- 求达人给个自动生成数据库表类对象的工具.我忘了
- 提交后如何遍历Repeater 中的 CheckBox ????
- 初学者,一个简单的ASP.NET问题!
- ★★★★★怎样实现当页面一加载DataGrid控件的第一行背景色变红?★★★★★
- 传奇经历:一夜之间你就变了为什么?
- 100分问一下,我的ASPNET程序为什么拿到服务器上去就不好使了呀?
- 2004年过的很快,大家说说一年来的总结以及对2005年的展望
- 关于显示
- 谁给一个连接SqlServer的类!
- 升星,发些代码,如果你有用!
- 高手们 : JIT调试失败,出现以下错误:拒绝访问。!!!!!!!!! 从来没有见过的大问题!!!!!
- 如何在IIS 6的日志中记录HTTP Header的信息?
改为
label2.Text="<a href='index.asp'>返回上页</a>"