Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I add record to the combo box ?
Message
De
05/08/2003 10:14:06
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
How do I add record to the combo box ?
Divers
Thread ID:
00816851
Message ID:
00816851
Vues:
58
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform