Hi @gal mor ,
You can set two input controls and two button controls. One input control is responsible for entering the name variable, and the other input control is responsible for entering the date variable.
Set two button controls, when you need to update name according to ID, select the corresponding button, in the same way, when you need to update date according to ID, select the corresponding button.
code:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input type="text" id="ID" name="ID" placeholder="ID">
<input type="text" id="name" name="name" placeholder="update for name">
<input type="text" id="date" name="date" placeholder="update for date">
<asp:Button ID="Button1" runat="server" text="UpdateName" OnClick="UpdateName" />
<asp:Button ID="Button2" runat="server" text="UpdateDate" OnClick="UpdateDate" />
public void UpdateName(object sender, EventArgs e)
{
string name = Request["name"];
string ID = Request["ID"];
string command = string.Format("update tablename set date = '{0}' where ID = '{1}'", name, ID);
//your sqlcommand code
}
public void UpdateDate(object sender, EventArgs e)
{
string date = Request["date"];
string ID = Request["ID"];
string command = string.Format("update tablename set date = '{0}' where ID = '{1}'", date, ID);
//your sqlcommand code
}
This allows you to update name when you need to update it, and update date when you update it
Best regards,
Qi You