Gridview Updating Problem

Mar 19 2013 5:45 PM
Heey all, im having a little problem with my gridveiw updating command, i have tryed almost every thing knownen to me

all it have to do is update text and "imagepath and imagename"

and i have chected the spelling of the database names 

Hope someone can help me


string connection = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                SqlConnection conn = new SqlConnection(connection);



                SqlCommand mySqlUpdate = new SqlCommand("UPDATE sv_Employee SET EmployeeName = @EmployeeName, EmployeeImage = @EmployeeImage WHERE EmployeeID = @EmployeeID", conn);

                mySqlUpdate.CommandType = CommandType.Text;

                mySqlUpdate.Parameters.Add("@EmployeeID", SqlDbType.Int).Value = Convert.ToInt32(lblEmployeeID.Text);
                mySqlUpdate.Parameters.Add("@EmployeeName", SqlDbType.NVarChar).Value = txtEmployeeName.Text;
                mySqlUpdate.Parameters.AddWithValue("@EmployeeImage", (imgPicture.ImageUrl == null ? (object)DBNull.Value : (object)imgPicture.ImageUrl));

                try
                {
                    conn.Open();
                    mySqlUpdate.ExecuteNonQuery();
                }
                finally
                {
                    conn.Close();
                }

Answers (1)