In the below code i have a dataset and html table .In my case i have dataset with 25 counts and i want to bind it to html table but it bind only first row .Pls help me to bind all rows .
MastersClient objIndent = new MastersClient();
DataSet ds = objIndent.GetIndent(hidIndentID.Value);
DataRow[] drIndentID = ds.Tables[0].Select("IndentID =" + hidIndentID.Value);
if (drIndentID.Length > 0)
{
//Count is 25
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
txtQty.Value = drIndentID[i]["RecommentedQuantity"].ToString();
string strProductID = drIndentID[i]["ProductID"].ToString();
ddlProduct.Text = strProductID;
txtDate.Text = drIndentID[i]["ProductRequiredDate"].ToString();
}
}
<table id="dataTable" width="350px" border="1" runat="server">
<tr>
<td><input id="checkbox" type="checkbox" name="chk" runat="server"/></td>
<td><input type="text" name="txt" id="txtQty" runat="server"/></td>
<td>
<asp:DropDownList ID="ddlProduct" runat="server" Style="width: 100%; height:23px" ></asp:DropDownList>
</td>
<td>
<asp:TextBox ID="txtDate" Style="text-align: left" onkeypress="return isNumberKey(event, false);"
onblur="DateValidation(this)" onkeyup="ValidateDate(this, event.keyCode)" onkeydown="return DateFormat(this, event.keyCode)"
Height="20px" runat="server" Width="80px"> </asp:TextBox>
</td>
</tr>
</table>