Hi I have a combo box, which is bound to some data like so.
VB Code:
Private Sub getmaindropdata() Try Dim dacontcom As New SqlDataAdapter ds.Tables("ContactsCom").Clear() Dim spgetconcom As New SqlCommand("spgetconcom", sqlcon, Nothing) spgetconcom.CommandType = CommandType.StoredProcedure dacontcom.SelectCommand = spgetconcom sqlcon.Open() dacontcom.Fill(ds, "ContactsCom") sqlcon.Close() Me.cbocompany.DataSource = ds Me.cbocompany.DisplayMember = "ContactsCom.CompanyName" Me.cbocompany.ValueMember = "ContactsCom.ContactID" Catch ex As Exception MsgBox(ex.ToString) End Try End Sub
Now I can't quite get my head out of a VBA mindset, but basically how do I do the below in .net
VB Code:
Private Sub cbocompany_AfterUpdate() popfields(me.cbocompany) ' me.cbocompany would give me the contactid End Sub
As always any help would be very much appricated.




Reply With Quote