Posted on: 10/30/2013 7:34:48 PM | Views : 668

I have a call to a stored procedure where I'm pulling user specific data and filling a web form with the values. I'm basically greating an adjust settings form. How can I change a dropdownlist to display the value that the user previously selected and was stored in the database? Below is my code:
if (this.IsPostBack == false) { SqlConnection conBD = new SqlConnection(connectionString); SqlCommand cmdBD = new SqlCommand("usp_GetDetails", conBD); cmdBD.CommandType = CommandType.StoredProcedure; cmdBD.Parameters.AddWithValue("@mkey", 192); // added value for testing SqlDataReader readerBD; try { conBD.Open(); readerBD = cmdBD.ExecuteReader(); if (readerBD.HasRows) { while (readerBD.Read()) { Drop ...

Go to the complete details ...