Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. load one field of all the records of a table into a listbox

load one field of all the records of a table into a listbox

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    danag
    wrote on last edited by
    #1

    I am trying to load a particular field of all records in a table into a listbox. when i run the exe, I am getting a messagebox with the error: too few paramaters expected one. what does this type of error mean??

    D T D 3 Replies Last reply
    0
    • D danag

      I am trying to load a particular field of all records in a table into a listbox. when i run the exe, I am getting a messagebox with the error: too few paramaters expected one. what does this type of error mean??

      D Offline
      D Offline
      dazinith
      wrote on last edited by
      #2

      it should be just:

      m_MyListBox.AddString(myRecord.m_strField1);

      you should post code if you want help with an error.. so we can see where the error is being caused. -dz

      D 1 Reply Last reply
      0
      • D danag

        I am trying to load a particular field of all records in a table into a listbox. when i run the exe, I am getting a messagebox with the error: too few paramaters expected one. what does this type of error mean??

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        The database query you're executing has probably a misspelled column name. Check the SQL text. Tomasz Sowinski -- http://www.shooltz.com

        What is "scratch" and why can everything be made from it?

        1 Reply Last reply
        0
        • D danag

          I am trying to load a particular field of all records in a table into a listbox. when i run the exe, I am getting a messagebox with the error: too few paramaters expected one. what does this type of error mean??

          D Offline
          D Offline
          dlhson
          wrote on last edited by
          #4

          too few paramaters expected one. I'm sure that your SQL command is incorrect;P Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com

          1 Reply Last reply
          0
          • D dazinith

            it should be just:

            m_MyListBox.AddString(myRecord.m_strField1);

            you should post code if you want help with an error.. so we can see where the error is being caused. -dz

            D Offline
            D Offline
            danag
            wrote on last edited by
            #5

            When I run it, I get the messagebox error and when the dialog appears, I donot have the fileds loaded? I have the code where I have tried to load the field.. void CMgen1View::OnInitialUpdate() { m_pSet = &GetDocument()->m_mgen1Set; CRecordView::OnInitialUpdate(); LoadListbox(); //CALLING HERE } void CMgen1View::LoadListbox() { CMgen1Doc* pDoc = GetDocument(); CListBox* pLB = (CListBox*) GetDlgItem(IDC_LIST1); CSectionSet sect(&pDoc->m_database); sect.Open(); while(!sect.IsEOF()) { pLB->AddString(sect.m_CourseID); sect.MoveNext(); } }

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups