Hi, I'm using a detailsview to Update a record and this is the code:
protected void newOrderDetailsView_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
string Query = "Update Orders Set note=@note ,orderDate = @orderDate ,dueDate = @dueDate,customerPurchaseOrder=@custPO, contact= @contact where orderId = @orderId";
try
{
SqlConnection con = DataAccess.Connection.GetDBConnection();
SqlCommand cmd = new SqlCommand(Query, con);
cmd.Parameters.Add("@note", SqlDbType.NVarChar, 255).Value = e.NewValues["note"].ToString();
cmd.Parameters.Add("@orderDate", SqlDbType.DateTime).Value = Convert.ToDateTime(e.NewValues["orderDate"]);
cmd.Parameters.Add("@dueDate", SqlDbType.DateTime).Value = Convert.ToDateTime(e.NewValues["dueDate"]);
...
Go to the complete details ...