G
Guest
Hi,
I have lots of trival databound forms that maintain simple tables that I
want to port to winforms and edit with a datagridview or similar.
I would like to achieve the following: Deriving from a baseclass
'DataBoundForm' or similar I want to be able to set a design-time sql select
statement and be able to visually do databinding and datagrid column
formattind etc using an untyped dataset with the schema of the sql select
statement.
1. I don't want to have to create lots of typed datasets and table adapters
so I have created a generic TableAdapter object implementing a generic
interface similar to those generated by the IDE. This accepts a simple Select
sql statement and creates all the CRUD stuff with a commandbuilder etc and
also can be the design time source of the schema info.
2. I have created a base form that has an instance of this tableadapter and
at design-time only, fills and returns an untyped dataset from the Sql
statement provided. The idea is to then be able to access this on the derived
form to use as the datasource for databinding, whether it be a datagridview
or the like.
3. What I would like to know is: is it possible to get this populated
untyped dataset to show up in the IDE as a valid datasource available for
databinding and doing the design work on the derived form.
Potential problems which I imagine might exist but don't really know about:
1. While the untyped dataset is populated during the instanciation of the
base class, this schema info etc may not be sufficient for the IDE to see it
as a valid data source.
2. If using a DataGridView, again the datagridview may not be able to
extract the schema to visually set up column formatting etc at designtime,
but I won't know this until I can solve point 1.
Any illumination on whether my goal is futile or if anyone can shed some
light on the matter would be excellent.
Thanks in advance.
Simon
I have lots of trival databound forms that maintain simple tables that I
want to port to winforms and edit with a datagridview or similar.
I would like to achieve the following: Deriving from a baseclass
'DataBoundForm' or similar I want to be able to set a design-time sql select
statement and be able to visually do databinding and datagrid column
formattind etc using an untyped dataset with the schema of the sql select
statement.
1. I don't want to have to create lots of typed datasets and table adapters
so I have created a generic TableAdapter object implementing a generic
interface similar to those generated by the IDE. This accepts a simple Select
sql statement and creates all the CRUD stuff with a commandbuilder etc and
also can be the design time source of the schema info.
2. I have created a base form that has an instance of this tableadapter and
at design-time only, fills and returns an untyped dataset from the Sql
statement provided. The idea is to then be able to access this on the derived
form to use as the datasource for databinding, whether it be a datagridview
or the like.
3. What I would like to know is: is it possible to get this populated
untyped dataset to show up in the IDE as a valid datasource available for
databinding and doing the design work on the derived form.
Potential problems which I imagine might exist but don't really know about:
1. While the untyped dataset is populated during the instanciation of the
base class, this schema info etc may not be sufficient for the IDE to see it
as a valid data source.
2. If using a DataGridView, again the datagridview may not be able to
extract the schema to visually set up column formatting etc at designtime,
but I won't know this until I can solve point 1.
Any illumination on whether my goal is futile or if anyone can shed some
light on the matter would be excellent.
Thanks in advance.
Simon