C#, Database Binding to ComboBox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • duke55
    New Member
    • Apr 2007
    • 3

    C#, Database Binding to ComboBox

    I have bounded a simple database, employee’s last name and first name to a combo box. Now I want the output to show the last name, separated by a comma, followed by first name (Smith, John). The smart tag of the comboBox only allows me to display either the first name or the last name. I tried bunch of setting in ‘add query’ and properties to no avail.

    Thank you
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by duke55
    I have bounded a simple database, employee’s last name and first name to a combo box. Now I want the output to show the last name, separated by a comma, followed by first name (Smith, John). The smart tag of the comboBox only allows me to display either the first name or the last name. I tried bunch of setting in ‘add query’ and properties to no avail.

    Thank you
    have u tried selecting your records like
    SELECT lastname+','+fi rstname FROM Tablename ?????

    Comment

    • duke55
      New Member
      • Apr 2007
      • 3

      #3
      It wouldn’t allow me to save the new query. The error message is: “The schema returned by the new query differs from the base query.” Then the only choice is OK and I have to cancel the new query. But your schema works, during the query builder and Execute Query, it shows the right order of names, but it wouldn’t let me save it. Have any other thoughts???

      Thanks

      Comment

      • duke55
        New Member
        • Apr 2007
        • 3

        #4
        Thanks, dip_developer

        It worked, I had to change the properties in ‘edit dataset with designer’ to your scheme and it worked.

        Thanks again.

        Comment

        • dip_developer
          Recognized Expert Contributor
          • Aug 2006
          • 648

          #5
          Originally posted by duke55
          Thanks, dip_developer

          It worked, I had to change the properties in ‘edit dataset with designer’ to your scheme and it worked.

          Thanks again.

          you are always welcome....by the way nothing to thanks.....we are here to share our knowledge....

          Comment

          Working...