Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to update dropdown values in Grid
    primarykey
    data
    text
    <p>Below is the code to update gridview. In gridview, i m using dropdownlists, datepicker and text boxes in the update grid. I m getting all the value correct.. Main issue is i m not able to update <strong>Case_Status</strong> and <strong>Case_Type</strong> in the database. if i m updating then both values updated as NULL in database. I checked the values of <strong>V1</strong> and <strong>V2</strong> by using breakpoints in Visual Studio. Both values are desired result. but updating NULL...</p> <p>On " <strong>GridView1.EditIndex = -1;</strong>" I am getting value <strong>4</strong> while checking through breakpoints..</p> <pre><code> con.Open(); SqlCommand cmd = new SqlCommand("UPDATE intakesheet SET case_number = @case_number, case_name = @case_name, Case_Type = @Case_Type, Case_Status = @Case_Status, assigned_date = @assigned_date, assigned_to = @assigned_to, date_withdrawn= @date_withdrawn, date_delivered= @date_delivered, qc_by = @qc_by, qc_date= @qc_date, additional_notes = @additional_notes WHERE (case_number = @case_number)", con); cmd.Parameters.Add("@case_number", SqlDbType.NVarChar).Value = case_number; cmd.Parameters.Add("@case_name", SqlDbType.NVarChar).Value = case_name; cmd.Parameters.AddWithValue("@Case_Type", v1); cmd.Parameters.AddWithValue("@Case_Status", v2); cmd.Parameters.Add("@assigned_date", SqlDbType.NVarChar).Value = assigned_date; cmd.Parameters.AddWithValue("@assigned_to", assigned_to); cmd.Parameters.AddWithValue("@date_withdrawn", date_withdrawn); cmd.Parameters.AddWithValue("@date_delivered", date_delivered); cmd.Parameters.AddWithValue("@qc_by", qc_by); cmd.Parameters.AddWithValue("@qc_date", qc_date); cmd.Parameters.Add("@additional_notes", SqlDbType.NVarChar).Value = additional_notes; cmd.ExecuteNonQuery(); GridView1.EditIndex = -1; con.Close(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload