Dim iname, ipass As String
iname = UserName.Text
ipass = Password.Text
AccessDataSource1.SelectCommand = "SELECT [username], [pass], [group] FROM [sysusert] where username='" + iname + "' and pass='" + ipass + "'"
Title = AccessDataSource1.SelectCommand
'判断accessdatasource是否有结果集
Dim dv As New DataView()
dv = DirectCast(AccessDataSource1.[Select](DataSourceSelectArguments.Empty), DataView)
If dv.Count = 1 Then
Session("username") = iname
Session("pass") = ipass
Response.Redirect("index.aspx")
Else
Title = "失败"
End If