Results 1 to 4 of 4

Thread: [2008] BindingNavigator\Dataset Problem

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    3

    [2008] BindingNavigator\Dataset Problem

    Hi,
    I'm trying to use a BindingNavigator, with a Dataset I created. I'm getting an error in the form.show event. Given below is my form load event can you please tell me what i am doing wrong here.

    The Error I get is "Cannot bind to the property or column Name on the DataSource. Parameter name: dataMember"

    Code:
        Private Sub frm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Connection.OpenConnection(Con)
    
            Dim s_SQL As String = "SELECT ListID, [Name] as fName FROM vw_EmployeeNames ORDER BY ListID"
            Dim cmd As New Data.SqlClient.SqlCommand(s_SQL, Con)
            da.SelectCommand = cmd
            Dim ds As New Data.DataSet
            da.Fill(ds, "vw_EmployeeNames")
    
            BindingSource.DataMember = "vw_EmployeeNames"
            BindingSource.DataSource = ds
    
            BindingNavigator.BindingSource = BindingSource
    
            lblEmpName.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource, "fName", True))
            lblEmpID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource, "ListID", True))
        End Sub
    Last edited by RandanaG; Jan 4th, 2009 at 04:30 AM.

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