当前位置:编程学习 > C#/ASP.NET >>

在位置 0 处没有任何行 谁能解决一下

Overrides Sub DataBind()
        MyBase.DataBind()
        LabelZH.Text = Session("memberNO").ToString
        LabelXM.Text = Session("membername").ToString
        Dim str1, strConn As String
        str1 = "select * from memberinfo where 账号='" + LabelZH.Text + "'"
        strConn = ConfigurationManager.AppSettings("strConn")
        Dim conn As New OleDbConnection(strConn)
        conn.Open()
        Dim cmd1 As New OleDbCommand(str1, conn)
        Dim adp1 As New OleDbDataAdapter(cmd1)
        Dim ds1 As New DataSet
        Dim n As Integer = adp1.Fill(ds1, "memberinfo")
        If (ds1.Tables("memberinfo").Rows(0)("性别").ToString() = "男") Then
            RadioButtonList1.SelectedIndex = 0
        Else
            RadioButtonList1.SelectedIndex = 1
        End If
        textboxMMWT.Text = ds1.Tables("memberinfo").Rows(0)("密码问题").ToString()
        textboxMMDA.Text = ds1.Tables("memberinfo").Rows(0)("密码答案").ToString()
        textboxYZBM.Text = ds1.Tables("memberinfo").Rows(0)("邮政编码").ToString()
        textboxEmail.Text = ds1.Tables("memberinfo").Rows(0)("E-mail").ToString()
        textboxTXDZ.Text = ds1.Tables("memberinfo").Rows(0)("通信地址").ToString()
        textboxLXDH.Text = ds1.Tables("memberinfo").Rows(0)("联系电话").ToString()
        textboxSHDZ.Text = ds1.Tables("memberinfo").Rows(0)("送货地址").ToString()
        textboxSZSS.Text = ds1.Tables("memberinfo").Rows(0)("所在省市").ToString()
        Select Case (ds1.Tables("memberinfo").Rows(0)("送货方式").ToString())
            Case "普通平邮" : DropDownList1.SelectedIndex = 0
            Case "送货上门" : DropDownList1.SelectedIndex = 2
            Case "特快专递(EMS)" : DropDownList1.SelectedIndex = 1
        End Select
        Select Case (ds1.Tables("memberinfo").Rows(0)("付款方式").ToString())
            Case "邮局汇款" : DropDownList2.SelectedIndex = 0
            Case "建设银行汇款" : DropDownList2.SelectedIndex = 1
            Case "特快专递(EMS)" : DropDownList2.SelectedIndex = 2
        End Select
    End Sub 急需解决 --------------------编程问答-------------------- 返回的数据为空,下一个断点在Dim n As Integer = adp1.Fill(ds1, "memberinfo")后面看看。 --------------------编程问答-------------------- ds1.Tables("memberinfo")这里判断下Rows.Count --------------------编程问答-------------------- select的返回结果集为空!要判断Rows.Count
补充:.NET技术 ,  .NET Framework
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,