I am saving dropdown list values to database , but when i am trying to retrieve the value saved in the database to dropdown, the dropdown default value shows different value
using (SqlConnection con = new SqlConnection(st))
{
con.Open();
SqlCommand cmd = new SqlCommand("spGetUploadedImage", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@PId", Convert.ToInt32(ddproject.SelectedValue.ToString()));
SqlDataReader rd = cmd.ExecuteReader();
if (rd.Read())
{
txtuserdomain.Text = rd["P_user_domain"].ToString();
txtawards.Text = rd["P_awards"].ToString();
txtcoverage.Text = rd["P_functional_coverage"].ToString();
txtfeatures.Text = rd["P_feature"].ToString();
txtimplementation.Text = rd["P_implementation"].ToString();
ddimportance.DataValueField = rd["Importance"].ToString();
}
}

Salman BegRank #284 · 8.8K reputationPosted Jan 31, 2019, 6:34 PM EST
sunny kumarRank #5,208 · 307 reputationPosted Jan 31, 2019, 7:38 PM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 31, 2019, 7:48 PM EST
sunny kumarRank #5,208 · 307 reputationPosted Jan 31, 2019, 7:53 PM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 31, 2019, 7:56 PM EST
sunny kumarRank #5,208 · 307 reputationPosted Jan 31, 2019, 7:59 PM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 31, 2019, 8:04 PM EST
sunny kumarRank #5,208 · 307 reputationPosted Jan 31, 2019, 8:10 PM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 31, 2019, 8:13 PM EST
sunny kumarRank #5,208 · 307 reputationPosted Jan 31, 2019, 8:22 PM EST
Salman BegRank #284 · 8.8K reputationPosted Jan 31, 2019, 8:31 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Jan 31, 2019, 9:33 PM EST
Sanwar RanwaRank #23 · 44.7K reputationPosted Jan 31, 2019, 6:28 PM EST