I am trying to figure out how to select data in a combobox whose dropdowastyle is dropdownlist.
when my form first loads, it populates the combox, named cmbox1 with the following statements;
lsql = "Select currency from [sec_mast].[dbo].[sec_fxrt] group by currency "
'
' populate first combox
'
Try
cmd = New SqlCommand(lsql, conn)
adapter.SelectCommand = cmd
adapter.Fill(ds)
adapter.Dispose()
cmd.Dispose()
cmbox1.DataSource = ds.Tables(0)
cmbox1.ValueMember = "currency"
cmbox1.DisplayMember = "currency"
Catch ex As Exception
MessageBox.Show("cannot open connection")
End Try
this works no problem. My problem is that I ca not figure out the correct steps to select a different currency in the cmbx1.
I have tried the Click method, but that executes once i click on the dropdown.
I have tried the selectedindexchange/selectedvalue change but I get my message when the form loads of No records
Can anyone suggest what I should try...ir shoiuld I try something else here
Thanks in advance for any information
when my form first loads, it populates the combox, named cmbox1 with the following statements;
lsql = "Select currency from [sec_mast].[dbo].[sec_fxrt] group by currency "
'
' populate first combox
'
Try
cmd = New SqlCommand(lsql, conn)
adapter.SelectCommand = cmd
adapter.Fill(ds)
adapter.Dispose()
cmd.Dispose()
cmbox1.DataSource = ds.Tables(0)
cmbox1.ValueMember = "currency"
cmbox1.DisplayMember = "currency"
Catch ex As Exception
MessageBox.Show("cannot open connection")
End Try
this works no problem. My problem is that I ca not figure out the correct steps to select a different currency in the cmbx1.
I have tried the Click method, but that executes once i click on the dropdown.
I have tried the selectedindexchange/selectedvalue change but I get my message when the form loads of No records
Can anyone suggest what I should try...ir shoiuld I try something else here
Thanks in advance for any information