Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 109,297 VB.NET Programmers for FREE! Ask your question and get quick answers from experts. There are 1,209 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Combobox Control DataBinding in VB.Net

 
Reply to this topicStart new topic

Combobox Control DataBinding in VB.Net, i bind combobox which shoe Student id For example 1,2,3 etc allready b

sajjadAslam
post 30 Jun, 2008 - 09:56 PM
Post #1


New D.I.C Head

*
Joined: 10 Jun, 2008
Posts: 1


My Contributions


I also want how combobox show student ID and Name together i have 2 fields in DataBase table."StudentId" and "Name".Plz Help me.
CODE

Query="select StudentID, Name From StudentRecord"
com = new sqlcommand
com.commandText = Query
da= new sqldataadapter
dt = new DataTable
da.selectcommand = com
da.fill(dt)
cmb1.DataSource = dt
cmb1.ValueMember = dt.columns("Name").ToString
cmb1.DisplayMembers = dt.columns("StudentID").ToString

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 9/6/08 09:42AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month