Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I add record to the combo box ?
Message
From
05/08/2003 10:14:06
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
How do I add record to the combo box ?
Miscellaneous
Thread ID:
00816851
Message ID:
00816851
Views:
57
Dear The Expert,
How do I add record to the combo box ? .. I wrote below codes for add record to the combobox and
then display them .. but it does not work .. am I missing something?

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim ds As DataSet = GetDataSet()
BindComboBox(ds)
End If
End Sub



Private Function GetDataSet() As DataSet
Dim mSQL As String
mSQL = "Select * from MyUserGroup Order by GroupID"
Dim con As New OleDbConnection(mConnectionString)
Dim cmd As New OleDbCommand(mSQL, con)
Dim adapter As New OleDbDataAdapter(cmd)
Dim dsGroup As New DataSet()
adapter.Fill(dsGroup, "UserGroup")
con.Close()
Return dsGroup
End Function

Private Sub BindComboBox(ByVal ds As DataSet)
ComboUserGroup.DataSource = ds.Tables("UserGroup")
Me.DataBind()
End Sub

TIA

Winan
Next
Reply
Map
View

Click here to load this message in the networking platform