i asuuming that you load your data list like this
<asp:datalist id="DataList1" runat="server" onselectedindexchanged="DataList1_SelectedIndexChanged">
<itemtemplate>
<table class="style1">
<tr>
<td>
<asp:label id="Label1" runat="server" text="<%#Eval("Id") %>"></asp:label>
</td>
<td>
<asp:button id="Button1" runat="server" text="Button" onclick="Button1_Click" />
</td>
</tr>
</table>
</itemtemplate>
</asp:datalist>
and so you button click will be same this code you can click button in each row in data list and get Id from each row in a textbox
protected void Button1_Click(object sender, EventArgs e)
{
Button BuyNowButton = (Button)sender;
DataListItem item = (DataListItem)BuyNowButton.NamingContainer;
Label NameLabel = (Label)item.FindControl("label1");
TextBox1.Text = NameLabel.Text;
}