TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sunny kumar
NA
333
9.4k
Show default value in dropdown list from database
Jan 31 2019 11:20 PM
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();
}
}
Reply
Answers (
13
)
Exe Creation for WinForms Application
In c# how to highlight the images from pdf document.