Results 1 to 4 of 4

Thread: dataview problem

  1. #1

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

    dataview problem

    In my VB.NET Project I have this code;

    Dim dv As DataView

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    OleDbDataAdapter1.Fill(DataSet11, "students")
    dv = DataSet11.Tables("students").DefaultView

    DataGrid1.DataSource = dv

    'to combo
    ComboBox1.DataSource = dv
    ComboBox1.DisplayMember = "Students"

    'But I encounter a problem.
    'The combobox lists all like this "System.Data.DataRowView"

    What should I do?

    Using dv as DataView, I dont know what code should I write to go to next or previous record?
    Kindly help me.. pls check the file I attached with this thread.
    Attached Files Attached Files

  2. #2
    Lively Member
    Join Date
    Jul 2003
    Location
    Kuala Lumpur (Malaysia)
    Posts
    92

    Smile

    Hi,

    What you want to display in the combobox ?

  3. #3
    Lively Member
    Join Date
    Jan 2002
    Posts
    105
    Try puting in .ValueMember = "Students" after the .DisplayMember line and see if that works.

    I don't see what is wrong with that above apart from the .ValueMember is missing.

  4. #4
    Lively Member
    Join Date
    Jul 2003
    Location
    Kuala Lumpur (Malaysia)
    Posts
    92

    Smile

    Hi,

    As i notice, you are trying to fill the combobox with the column "students" that is not exist in your database. You cannot put the whole table into the conbobox without more wrok to be done.


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