VB Dataset Problem

Discussion in 'OT Technology' started by Lou, Jan 14, 2007.

  1. Lou

    Lou New Member

    Joined:
    Sep 13, 2004
    Messages:
    185
    Likes Received:
    0
    I'm not a particularly big fan of VB and I'm having trouble getting values from a dataset. My table is called tblCustID and contains 3 columns, CustomerID, CustFirstName, CustLastName. I have my customer ID being populated in the listbox at present but i'm trying to get my customer first and list name concatenated into the box instead. My dataset is called DsCustomerList and i'm attempting to use bindingcontext to get the values.

    I'm currently trying something along these lines...


    Dim strCustNameFull

    Me.BindingContext(DsCustomerList1.tblCustID).Position = 0
    Do until Me.BindingContext(DsCustomerList1.tblCustID).Position = Me.BindingContext(DsCustomerList1.tblCustID).Count - 1

    StrCustNameFull = Me.BindingContext(DsCustomerList1.tblCustID, "CustFirstName") + Me.BindingContext(DsCustomerList1.tblCustID, "CustLastName")

    Me.BindingContext(DsCustomerList1.tblCustID).Position += 1

    Loop

    I'm thinking however that I may need some sort of array in here with length being equal to count. However this is causing absolute chaos and my mind cannot get to work on coding it.

    If anyone could help, it would be greatly appreciated as I'm really not too hot on VB. :x:
     
  2. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Can't say as I have any idea what your problem is. You're trying to use FirstName+LastName as your unique identifier but it's not working? Is that the problem? What errors are you getting? Your question is way too vague, and it sounds disturbingly like homework too.
     

Share This Page