|
-
Mar 4th, 2005, 03:17 AM
#1
Thread Starter
New Member
combobox prob
hi,
i want to know how i can populate my combobox using data directly from database (sql server ) and after how can i store the selectedindex (ie item selected by user) in another table. if u have any codes, post it here for me. i badly need help. HELP ME PLTZZZZZ!
thks. but do u have the equivalent code in vb.net please.a m using vb.net + sql server
-
Mar 4th, 2005, 08:41 AM
#2
Fanatic Member
Re: combobox prob
You have to loop across a recordset or an array to populate the combo.
VB Code:
Dim rs as DAO.Recordset
rs = db.OpenRecordset("MyTable")
With rs
.MoveLast
.MoveFirst
Do While Not .EOF
MyCombo.Items.Add(.Fields("ListName").Value)
If Not .EOF Then .MoveNext
End Do
End With
MyCombo.Text = txtUserSelectedValue.Text
-
Mar 4th, 2005, 09:25 AM
#3
Re: combobox prob
 Originally Posted by pvbangera
You have to loop across a recordset or an array to populate the combo.
VB Code:
Dim rs as DAO.Recordset
rs = db.OpenRecordset("MyTable")
With rs
.MoveLast
.MoveFirst
Do While Not .EOF
MyCombo.Items.Add(.Fields("ListName").Value)
If Not .EOF Then .MoveNext
End Do
End With
MyCombo.Text = txtUserSelectedValue.Text
why O why would you be using DAO????
-
Mar 4th, 2005, 09:36 AM
#4
Fanatic Member
Re: combobox prob
I am comfortable with it.
-
Mar 4th, 2005, 09:40 AM
#5
Re: combobox prob
 Originally Posted by pvbangera
I am comfortable with it. 
well you should look into ADO.NET, not only is if faster than ADO, its worlds faster than DAO, DAO isn't even supported by MS anymore
-
Mar 4th, 2005, 09:42 AM
#6
Fanatic Member
Re: combobox prob
will u suggest ne site or link to e-book for learning ADO.Net. I dont even know ADO.
-
Mar 4th, 2005, 09:57 AM
#7
-
Mar 4th, 2005, 08:28 PM
#8
Re: combobox prob
 Originally Posted by shei786
hi,
i want to know how i can populate my combobox using data directly from database (sql server ) and after how can i store the selectedindex (ie item selected by user) in another table. if u have any codes, post it here for me. i badly need help. HELP ME PLTZZZZZ!
thks. but do u have the equivalent code in vb.net please.a m using vb.net + sql server
hey you ask this question here. http://vbforums.com/showthread.php?t=327348
try my code if that what you needed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|