DOTNET:INSERTING THE TEXTBOX VALUES INTO DATABASE ON BUTTONCLICK

protected void b1_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "Insert into Products(seller_id,product_name,product_desc,product_price,product_images) values('" + SellerId.ToString() + "','" + t1.Text + "','" + t5.Value + "','" + t3.Text + "','" + b.ToString() + "')";
cmd.ExecuteNonQuery();
con.Close();
}

Leave a Reply

Your email address will not be published. Required fields are marked *