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
Jagjit Saini
NA
166
0
How to display Data in DropDown List
Jun 13 2011 2:25 AM
Hi
public List<nsBo.clsorgprp> disp_rec()
{
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlCommand cmd = new SqlCommand("disp_org", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader dr = cmd.ExecuteReader();
List<nsBo.clsorgprp> obj = new List<nsBo.clsorgprp>();
while (dr.Read())
{
nsBo.clsorgprp k = new nsBo.clsorgprp();
k.p_orgcod = Convert.ToInt32(dr[0]);
k.p_orgnam = dr[1].ToString();
k.p_orgdom = dr[2].ToString();
k.p_orgcrtdat = Convert.ToDateTime(dr[3]);
obj.Add(k);
}
dr.Close();
cmd.Dispose();
con.Close();
return obj;
}
Now in Presentation layer i want to display name in drop down list and value field = code. How it can be done.
Thanks
Reply
Answers (
1
)
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
Excel like Gridview