I have an application that loads cars data from sql server database as follows.
sql = " select car.*, (model + ' -- ' + plateNo) as selectCar from car"
daAdapter = New SqlDataAdapter(sql, sqlConn)
tblBrand = New DataTabl
tblBrand = dsDataset.Tables("car").DefaultView.ToTable(True, "brand")
tblBrand.TableName = "brand"
Dim newCar As New frmCar(dsDataset)
carMode = "new"
Sub New(ByVal dsOptions)
cmbBrand.DataSource = dsOptions.table("brand")
cmbBrand.DisplayMember = "brand"
cmbBrand.ValueMember = "brand"
Catch ex As Exception
Public member 'table' on type 'DataSet' not found.
The first thing you should do is to turn both option strict and explicit
On. This will prevent you from doing these kinds of mistakes in the future.
The error is quite self-explainable. A
DataSet doesn't have a public member (property, method etc..) named
All you have to do is change:
Sub New(ByVal dsOptions) cmbBrand.DataSource = dsOptions.table("brand")
Sub New(ByVal dsOptions As DataSet) cmbBrand.DataSource = dsOptions.Tables("brand")