Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to bind a table data to textBox control

it should be like this

<img src="http://www.maxupload.net/images/05950700839676014758_thumb.jpg" border="0" alt="05950700839676014758.jpg" />




Thanks & Regards

:rose: rpkaran :rose:
Posted
Updated 18-May-11 22:10pm
v2

Use a data control. Place the textboxes in the itemtemplate and bind the control. Something like this(according to image)

XML
<asp:Repeater ID="rptDocuments" runat="server" >      
      <ItemTemplate>
                  <tr>
                    <td >
                       
                     <asp:TextBox ID="TextBox1" runat="server" Width="10" Visible="false" Text='<%# DataBinder.Eval(Container.DataItem,"ColumnName") %>'></asp:TextBox>
                    </td>
                  </tr>
      </ItemTemplate>    
      </asp:Repeater>
 
Share this answer
 
try like this
DataSet ds = new DataSet();
da.Fill(ds, "employee");
// Bind to FirstName column of the Employees table 
textBox1.DataBindings.Add("text", ds, "employee.firstname");
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900