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




Reply With Quote