黑色火焰LQ
黑色火焰LQ
关注数: 0
粉丝数: 5
发帖数: 61
关注贴吧数: 13
帮忙查找错误,谢谢 帮忙查找一下下面的错误Public Class Scores Inherits System.Web.UI.Page#Region " Web 窗体设计器生成的代码 " '该调用是 Web 窗体设计器所必需的。 Private Sub InitializeComponent() End Sub Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel Protected WithEvents rblClass As System.Web.UI.WebControls.RadioButtonList Protected WithEvents ckbStudents As System.Web.UI.WebControls.CheckBoxList Protected WithEvents dltScores As System.Web.UI.WebControls.DataList '注意: 以下占位符声明是 Web 窗体设计器所必需的。 '不要删除或移动它。 Private designerPlaceholderDeclaration As System.Object Private Sub BindList() Dim strWhere As String Dim itm As ListItem For Each itm In ckbStudents.Items If itm.Selected Then If strWhere <> String.Empty Then strWhere &= "OR" End If strWhere &= "tblStudents.StudentID=" & itm.Value & "" End If Next If strWhere <> String.Empty Then dltScores.Visible = True Dim conn As New System.Data.SqlClient.SqlConnection("server=LIUQI;integrated security=SSPI;initial catalog=StudentMS") Dim cmd As New System.Data.SqlClient.SqlCommand cmd.Connection = conn cmd.CommandText = "SELECT Name AS 姓名,Average AS 平均成绩,Total AS 总分 FROM tblStudents JOIN tblScores ON tblStudents.StudentsID=tblScores.StudentsID WHERE" & strWhere conn.Open() Dim dr As System.Data.SqlClient.SqlDataReader dr = cmd.ExecuteReader dltScores.DataSource = dr dltScores.DataBind() dr.Close() conn.Close() Else dltScores.Visible = False End If End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: 此方法调用是 Web 窗体设计器所必需的 '不要使用代码编辑器修改它。 InitializeComponent() End Sub#End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Me.IsPostBack Then Dim conn As New System.Data.SqlClient.SqlConnection("server=LIUQI;integrated security=SSPI;initial catalog=StudentMS") Dim cmd As New System.Data.SqlClient.SqlCommand("SELECT DISTINCT Class FROM tblStudents", conn) conn.Open() Dim dr As System.Data.SqlClient.SqlDataReader dr = cmd.ExecuteReader rblClass.DataSource = dr rblClass.DataTextField = "Class" rblClass.DataBind() dr.Close() conn.Close() End If '在此处放置初始化页的用户代码 End Sub Private Sub dltScores_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles dltScores.ItemCommand Select Case e.CommandName Case "select" dltScores.SelectedIndex = e.Item.ItemIndex BindList() Case "undelect" dltScores.SelectedIndex = -1 BindList() End Select End Sub Private Sub rblClass_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rblClass.SelectedIndexChanged Dim conn As New System.Data.SqlClient.SqlConnection("server=LIUQI;integrated security=SSPI;initial catalog=StudentMS") Dim cmd As New System.Data.SqlClient.SqlCommand cmd.Connection = conn cmd.CommandText = "SELECT*FROM tblStudents WHERE Class=" & rblClass.DataTextField & "" conn.Open() Dim dr As System.Data.SqlClient.SqlDataReader dr = cmd.ExecuteReader ckbStudents.DataSource = dr ckbStudents.DataTextField = "Name" ckbStudents.DataValueField = "StudentID" ckbStudents.DataBind() dr.Close() conn.Close() End Sub Private Sub ckbStudents_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ckbStudents.SelectedIndexChanged BindList() End SubEnd Class
登录页面问题,谢谢 代码如下: Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If Page.IsValid Then Dim SqlConnection1 As New System.Data.SqlClient.SqlConnection SqlConnection1.ConnectionString = "server=LIUQI;integrated security=SSPI;initial catalog=StudentMS" Dim StrSQL As String = "Select UserID,Password,UserType From tblUsers Where LoginName=" & Trim(txtName.Text) & "" Dim SqlCommand As New System.Data.SqlClient.SqlCommand SqlCommand.Connection = SqlConnection1 SqlCommand.CommandType = CommandType.Text SqlCommand.CommandText = "SELECT*FROM tblUsers" Dim dr As System.Data.SqlClient.SqlDataReader Try SqlConnection1.Open() dr = SqlCommand.ExecuteReader If dr.Read() Then If dr(1) = Trim(txtPassword.Text) Then Session("UserName") = Trim(txtName.Text) Response.Redirect("Scores.aspx") Else lblMessage.Text = "密码错误!请重新输入!" End If Else lblMessage.Text = "用户名不存在!" End If dr.Close() Catch ex As Exception lblMessage.Text = ex.Message Finally If SqlConnection1.State = ConnectionState.Open Then SqlConnection1.Close() End If End Try End If End Sub以上代码是按照教科书中打的,但是在网页中输入用户名密码后会显示“密码错误!请重新输入!”里面有错误但是我找不到,请那位高手帮帮我,谢谢!
怎么在linux 中设置虚拟内存的大小? 请问,怎么在linux 中设置虚拟内存的大小?,谢谢。
许愿瓶 呱呱呱,请把你许好的愿望塞进去吧!主会看到的,OM 。 许愿瓶,呱呱呱,请把你许好的愿望塞进去吧!主会看到的,OM 。
1
下一页