Results 1 to 12 of 12

Thread: [RESOLVED] selected combo item bug!

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Resolved [RESOLVED] selected combo item bug!

    Hi ,

    I am combining 2 fields in a combo box one of which is the supplierName and L/A No as alias ordersupplier which loads fine in the combo box. But when it comes to capturing the SupplierID it is always = 1.
    Below is my code in red to capture this value. Does anyone have any idea why Im getting this bug?

    Code:
    SELECT tb_LA.LANo, tb_supplier.supplierID, (RTRIM(tb_LA.LANo) + '- & - ' + tb_supplier.suppName) AS OrderSupplier FROM tb_LA 
    INNER JOIN tb_supplier ON tb_LA.supplierFID=tb_supplier.supplierID

    [
    Code:
    CODE]Dim query As String = "LASupp_Combo"
            Dim dtLASuppReport As New DataTable()
            Dim daLASuppReport As New SqlClient.SqlDataAdapter()
    
            Try
                Dim cmd As New SqlClient.SqlCommand(query, MyConn)
                cmd.CommandType = CommandType.Text
    
                daLASuppReport.SelectCommand = cmd
                daLASuppReport.Fill(dtLASuppReport)
                cboLASupp.DataSource = dtLASuppReport
                cboLASupp.DisplayMember = "OrderSupplier"
                cboLASupp.ValueMember = "LANo"
                supplierFID = CInt(CType(cboLASupp.SelectedItem, DataRowView).Item("supplierID"))
    [/CODE]
    Last edited by angelica; Sep 18th, 2008 at 01:35 PM.
    ------------------------------------------------------------------------
    If an answer to your question has been helpful, then please, Rate it!

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