-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: ShRaj_tup
Message 1 in Discussion
hi,
I want to write a function filling the combo box with dynamic biniding of
combobox in base form
I have to fill the userLevel in the first combo and user name in the second
combo as per level
how to fill the combo box with the dynamic table creation.
?? how should the dispalymember , datamember of a combo box can be called
?? How to fill the table ...
how to fetch data where "??" is used...
The code goes like ...
'' How to fill the table ... ??
'' how to bind the combo box ??
'Connection
oledbConnection = New OleDb.OleDbConnection
oledbConnection.ConnectionString = "User ID=sa;Data
Source=SHANMUGARAJ;pwd=raja;Tag with column collation when possible=False;" & _
"Initial Catalog=Money;Use Procedure for Prepare=1;Auto
Translate=True;Persist Se" & _
"curity Info=False;Provider=""SQLOLEDB.1"";Workstation
ID=SHANMUGARAJ;Use Encryptio" & _
"n for Data=False;Packet Size=4096"
oledbConnection.Open()
'Define Dynamic Dataset , Table , column , row
Dim ds As New DataSet
Dim dt As New DataTable
Dim dcD As New DataColumn
Dim dcV As New DataColumn
Dim dtR As DataRow
ds.Tables.Add(dt)
dt.Columns.Add(dcD)
dt.Columns.Add(dcV)
'Adaptor , Command
Dim oleAdap As New OleDb.OleDbDataAdapter
Dim oleCmd As New OleDb.OleDbCommand
oleCmd.Connection = oledbConnection
oleCmd.CommandText = "select Ulevel from UserLevel" '' The qry must
be sent via function
oleAdap.SelectCommand = oleCmd
oleAdap.Fill(dt)
'' How to fill the table ... ??
With dt
dtR = ds.Tables(0).NewRow
dtR.BeginEdit()
dtR.Item(0) = ??
dtR.Item(1) = ??
dtR.EndEdit()
End With
'' how to bind the combo box ?? ' '' The combobox must be sent via function
'setCombo with values
With combobox
.DataSource = ds.Tables("dt")
.DisplayMember = ??
.ValueMember =??
End With
cboLevel.SelectedIndex = -1
oledbConnection.Close()
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]