asp.net怎么能让session传递求大神帮写vb.net写的
ProtectedSubButton1_Click(senderAsObject,eAsEventArgs)HandlesButton1.ClickDimmyconnAs...
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim myconn As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|数据表.accdb;")
myconn.Open()
Dim sql As String = "select * from [表1] where ID='" & (TextBox1.Text) & "' and PWD ='" & (TextBox2.Text) & "'"
Dim da1 As New OleDb.OleDbDataAdapter(sql, myconn)
Dim ds1 As New DataSet
da1.Fill(ds1, "[表1]")
If ds1.Tables(0).Rows.Count = 0 Then
MsgBox("账号或密码错误!")
TextBox1.Text = ""
TextBox1.Focus()
TextBox2.Text = ""
TextBox2.Focus()
Else
Session("ID") = OleDb.OleDbDataReader
Response.Redirect("about.aspx") 展开
Dim myconn As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|数据表.accdb;")
myconn.Open()
Dim sql As String = "select * from [表1] where ID='" & (TextBox1.Text) & "' and PWD ='" & (TextBox2.Text) & "'"
Dim da1 As New OleDb.OleDbDataAdapter(sql, myconn)
Dim ds1 As New DataSet
da1.Fill(ds1, "[表1]")
If ds1.Tables(0).Rows.Count = 0 Then
MsgBox("账号或密码错误!")
TextBox1.Text = ""
TextBox1.Focus()
TextBox2.Text = ""
TextBox2.Focus()
Else
Session("ID") = OleDb.OleDbDataReader
Response.Redirect("about.aspx") 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询