Results 1 to 5 of 5

Thread: After update on Combo box [Resolved]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    262

    Resolved After update on Combo box [Resolved]

    Hi I have a combo box, which is bound to some data like so.

    VB Code:
    1. Private Sub getmaindropdata()
    2.         Try
    3.             Dim dacontcom As New SqlDataAdapter
    4.             ds.Tables("ContactsCom").Clear()
    5.             Dim spgetconcom As New SqlCommand("spgetconcom", sqlcon, Nothing)
    6.  
    7.             spgetconcom.CommandType = CommandType.StoredProcedure
    8.  
    9.             dacontcom.SelectCommand = spgetconcom
    10.  
    11.             sqlcon.Open()
    12.             dacontcom.Fill(ds, "ContactsCom")
    13.  
    14.  
    15.             sqlcon.Close()
    16.  
    17.             Me.cbocompany.DataSource = ds
    18.             Me.cbocompany.DisplayMember = "ContactsCom.CompanyName"
    19.             Me.cbocompany.ValueMember = "ContactsCom.ContactID"
    20.  
    21.         Catch ex As Exception
    22.             MsgBox(ex.ToString)
    23.  
    24.         End Try
    25.     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:
    1. Private Sub cbocompany_AfterUpdate()
    2. popfields(me.cbocompany) ' me.cbocompany would give me the contactid
    3. End Sub

    As always any help would be very much appricated.
    Last edited by Oliver1; Jan 26th, 2006 at 11:34 AM. Reason: Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width