Results 1 to 8 of 8

Thread: ImageCombo and DataSource [Resolved]

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    ImageCombo and DataSource [Resolved]

    Hi

    I need to list in a ImageCombo all entries from a RecordSet

    I have the following:

    ...
    Set cbo.DataSource = MyRs
    cbo.DataField = "Designacao"
    ...

    But with this code I only list the first entry and not all. Can you help?

    Regards
    Luis
    Last edited by Tugabargains; Aug 3rd, 2005 at 10:56 AM.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: ImageCombo and DataSource

    Could you post more code? Are you sure there are more than one record that is returned by your recordset?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    Re: ImageCombo and DataSource

    ...
    With MyRs
    .CursorLocation = adUseServer
    .CursorType = adOpenKeyset
    .LockType = adLockOptimistic
    .Open "SELECT Designacao FROM CtrlTipoTerminal", Conn
    End With

    While Not MyRs.EOF
    straux = MyRs("Designacao")
    cbo.ComboItems.Add , , straux
    MyRs.MoveNext
    Wend
    ...

    with this code I can list all entries (at the moment 10) but if I use the following code it only lists the first one

    With MyRs
    .CursorLocation = adUseServer
    .CursorType = adOpenKeyset
    .LockType = adLockOptimistic
    .Open "SELECT Designacao FROM CtrlTipoTerminal", Conn
    End With

    Set cbo.DataSource = MyRs
    cbo.DataField = "Designacao"

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    Re: ImageCombo and DataSource

    Any ideas why this happens?

    Regards

  5. #5
    New Member
    Join Date
    Aug 2005
    Posts
    2

    Re: ImageCombo and DataSource

    use + sign while filling the combo
    like
    rs!rollno + rs!name

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: ImageCombo and DataSource

    If your code at the upper part works then why use the bottom part? Databound controls have their disadvantages too. Take a look at my sig.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    35

    Re: ImageCombo and DataSource

    Thank you. Now I am just curious to find out why does not work.
    What problems can I find with databound?

  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: ImageCombo and DataSource

    In the "Data Binding is Evil" link in my signature.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

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