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();
}
}
Jignesh KumarPosted Feb 1, 2019, 2:33 AM
Salman BegPosted Feb 1, 2019, 1:31 AM
sunny kumarPosted Feb 1, 2019, 1:22 AM
Salman BegPosted Feb 1, 2019, 1:13 AM
sunny kumarPosted Feb 1, 2019, 1:10 AM
Salman BegPosted Feb 1, 2019, 1:04 AM
sunny kumarPosted Feb 1, 2019, 12:59 AM
Salman BegPosted Feb 1, 2019, 12:56 AM
sunny kumarPosted Feb 1, 2019, 12:53 AM
Salman BegPosted Feb 1, 2019, 12:48 AM
sunny kumarPosted Feb 1, 2019, 12:38 AM
Salman BegPosted Jan 31, 2019, 11:34 PM
Sanwar RanwaPosted Jan 31, 2019, 11:28 PM