为什么要这样绑定呢?
TextBox1.Text = dataset11.Tables[Employees].Rows[0]FirstName;
就可以了

解决方案 »

  1.   

    错了,应该是
    TextBox1.Text = dataset11.Tables[Employees].Rows[0]["FirstName"];
      

  2.   

    Try
                dad.SelectCommand = New OleDbCommand("select * from location where residentid=" + CStr(rid), con)
                dad.Fill(dst, "location")
                dtb = dst.Tables("location")
                If dtb.Rows.Count = 1 Then
                    drow = dtb.Rows(0)
                    section.Text = drow("section")
                    ward.Text = drow("ward")
                    room.Text = drow("room")
                    bed.Text = drow("bed")            End If
            Catch io As Exception
                Response.Write(io.ToString())        End Try
      

  3.   

    niqiu322(孤寂的天蝎):
      高手,我只是想绑定, 并不是要赋值呀
      

  4.   

    不懂你说的什么意思
    在后台TextBox1.Text = dataset11.Tables[Employees].Rows[0]["FirstName"];
    就可以得到了。
      

  5.   

    to 楼主:
       如果你想绑定数据库中的数据到TextBox,可以把这个TextBox放到一个datalist或reaptear里面。因为TextBox自己不能绑定数据库,而在数据绑定组建里面可以通过设定他的Text=‘<%# DataBinderee.Eval()%》’来实现。
      

  6.   

    TextBox1.Text = dataset11.Tables[Employees].Rows[0]["FirstName"].tostring;
      

  7.   

    各位大哥:
      下面是从设计器里面的DataBindings属性中绑定好, 生成的Html代码, 我只是想用Server端的代码实现它而已:
    <asp:textbox id="TextBox1" style="Z-INDEX: 102; LEFT: 120px; POSITION: absolute; TOP: 48px" runat="server" Text='<%# DataBinder.Eval(dataSet11, "Tables[Employees].DefaultView.[0].FirstName") %>'></asp:textbox>请注意Text属性:Text='<%# DataBinder.Eval(dataSet11, "Tables[Employees].DefaultView.[0].FirstName") %>'
    这个东西只有静态可以设, 动态就不能设?
      

  8.   

    to snowjin78(方圆):
      不知你说的reaptear是不是Repeater, 但是Repeater里面也不能放TextBox呀