Windows Form Combobox Bind Problem with valuemember

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KalariaNitya
    New Member
    • Apr 2008
    • 34

    Windows Form Combobox Bind Problem with valuemember

    Hello all,

    i m stuck in how to bind combobox with valuemember

    i have four fields in database like..in table agent_master
    id =a00001
    firstname = nitya
    middlename = v
    lastname = kalaria

    now i want all record from agent_master

    in combobox want to bind record like i.e. nitya v kalaria and it's valummber is it's id a00001

    can anybody help me how to do that?

    thanking u in advanced...

    Cheers..
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    Please refer this Article

    Comment

    • KalariaNitya
      New Member
      • Apr 2008
      • 34

      #3
      Hey Shweta,

      thanks for ur kind help..

      i solved my problem.. below is the partial pasted code

      For i = 0 To arrfullname.Cou nt - 1
      cmbPolicyHolder Name.Items.Add( i)
      Next


      once again thanks..

      Comment

      • sharifee
        New Member
        • Oct 2008
        • 9

        #4
        Do it Like this.

        DataAccess da = new DataAccess();
        DataTable dt = da.SelectRecord ("SELECT Day.* FROM [Day];");
        comboBox1.DataS ource = dt;
        comboBox1.Displ ayMember = "Day_ID";
        comboBox1.Value Member = "Day_Name";

        Comment

        Working...