We have SQLForums SortedList,can we use it as a DataSource for dropdownlist in ASP.Net.
SortedList SQLForums = new SortedList();
SQLForums.Add("1", "MSDN Forum");
SQLForums.Add("2", "SQLServerCentral");
SQLForums.Add("3", "StackOverFlow");
SQLForums.Add("4", "SQL Team");
ddlSQLForums.DataSource = SQLForums;
ddlSQLForums.DataTextField = "Value";
ddlSQLForums.DataValueField = "Key";
ddlSQLForums.DataBind();
That’s It.
Enjoy Learning.
No comments:
Post a Comment