D
dm_dal
I know you can bind a dataset to a Windows.Forms.Control such as a
comboBox .... but, was wondering if you can do the same to a class object?
Example:
Create a simple class (we'll call it clsEmployee)
Create some properties of the employee like firstName, lastName etc...
Create your SqlDataAdapter and DataSet and fill your SqlDataAdapter
Create a DataViewManager and set it equal to the DataSet.DefaultViewManager
In a typical comboBox scenario, you would set you comboBox's "DataSource"
to the DataViewManager and then set the comboBox's DisplayMember to
(Table.FieldName) and the ValueMember to (Table.FieldName)
I would like to be able to do this with my class properties:
emp.firstName = (Table.FieldName);
emp.lastName = (Table.FieldName);
Can this be done? Obviously not through the means described above sind
clsEmployee does not have a "DataSource" property, but is there another way?
dave
comboBox .... but, was wondering if you can do the same to a class object?
Example:
Create a simple class (we'll call it clsEmployee)
Create some properties of the employee like firstName, lastName etc...
Create your SqlDataAdapter and DataSet and fill your SqlDataAdapter
Create a DataViewManager and set it equal to the DataSet.DefaultViewManager
In a typical comboBox scenario, you would set you comboBox's "DataSource"
to the DataViewManager and then set the comboBox's DisplayMember to
(Table.FieldName) and the ValueMember to (Table.FieldName)
I would like to be able to do this with my class properties:
emp.firstName = (Table.FieldName);
emp.lastName = (Table.FieldName);
Can this be done? Obviously not through the means described above sind
clsEmployee does not have a "DataSource" property, but is there another way?
dave