Yes it is possible. But you would require to identify which operation is being performed. Such as if you have newly entered data in the input form, you obviously want to insert it. Set a flag in the code saying
"INSERT"
.
When you are editing a record, you would require to update it, while doing this, set the same flag as
"UPDATE"
.
Sample Code:
string private strflag = string.Empty;
protected void Button_Click(object sender, EventArgs e)
{
if(strflag.toUpper() == "INSERT")
{
}
else if(strflag.toUpper() == "UPDATE")
{
}
}