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
Hussain Javed
NA
0
12.6k
drpdn SelectedValue is invalid because not exist in list
Sep 15 2015 6:26 AM
here is my code
protected void ddlDDLQualifi()
{
try
{
//open the db connection if it is closed...
if (con.State == ConnectionState.Closed)
con.Open();
cmd = new SqlCommand();
cmd.CommandText = "sp_Get_Qualification";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
DDLQualifi.DataSource = cmd.ExecuteReader();
DDLQualifi.DataTextField = "Education_Type";
DDLQualifi.DataValueField = "Education_Id";
DDLQualifi.DataBind();
DDLQualifi.Items.Insert(0, new ListItem("--Select--", "0"));
}
catch (Exception ex)
{
throw ex;
}
finally //Close db Connection if it is open....
{
if (con.State == ConnectionState.Open)
con.Close();
}
}
the value is binded and it shows value when i saw while debugging but it shows error like this"DDLQualifi' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value"
Reply
Answers (
1
)
How to send the request using access token in web api
How to bind Datalist on dropdown change where its binded?