Results 1 to 2 of 2

Thread: data view

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441

    data view

    In my project, I have a ComboBox and a DataGrid.
    On the Load of the Form, I put this code;

    OleDbDataAdapter1.Fill(DataSet11, "students")
    Dim dv As DataView
    dv = DataSet11.Tables("students").DefaultView
    MessageBox.Show(dv.Count)
    DataGrid1.DataSource = dv

    'to combo
    Dim a As Integer
    For a = 1 To dv.Count
    ComboBox1.Items.Add(dv.Item(0))
    Next

    My first problem is in the ComboBox, How can I add all the Student No to ComboBox?
    I tried the code above but doesn't work. Please help me with this?

    And my second question is, how can I go to Next or Previous record and how to delete records?

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    You have to read a little more about data binding with windows forms.
    For a start look here.
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/dndotnet/html/databindingadonet.htm
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

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