J
Jim Rand
VS 2005 provides for dragging tables from a server connection to the dataset
designer creating both data tables and related table adapters. For the most
part, the relationships between tables are automatically discovered and
rendered on the designer surface.
For my application, it is necessary to change each SELECT, UPDATE, INSERT
and DELETE statement to customize the handling of timestamps (TS --> CAST(TS
AS INT) AS TS), concurrency conflict handling and retrieving the
autoincrement keys. OK - that's fine but somewhat painful (i.e., labor
intensive [12 tables * 4 sql statements]).
Switching from SQL Server 2000 to SQL Server 2005, you go from a table owner
to schema name metaphor. For example, dbo.OfficeType becomes
AgentNET.OfficeType where dbo is the owner (in 2000) and AgentNET is the
schema (in 2005).
Making the change in the designer should be relatively simple by changing
the underlying SQL statements as in:
SELECT OfficeTypeID, OfficeType, Description, ListOrder, CAST(TS AS INT) AS
TS FROM dbo.OfficeType
SELECT OfficeTypeID, OfficeType, Description, ListOrder, CAST(TS AS INT) AS
TS FROM AgencyNET.OfficeType
However, the designer appears to have screwed up the relationships between
tables preventing the application from working. The only fix was to delete
the xsd file and start over from scratch!
The dataset is a disconnected container for holding a subset of the data on
the desktop. The table adapter is not part of the dataset - it is a wrapper
to the data adapter that handles CRUD (create, read, update, delete)
operations. Combining both dataset and adapters clouds the distinction.
Using the designer, changing where the data comes from breaks the container.
For my development, I'm going back to having one container (xsd) for the
dataset with no table adapters and a separate container for the data
adapters. That way, the backend can be changed without breaking the rest of
the application. So much for dragging tables to designer surface ever
again.
This was definitely one of those "You've got to be **#&$*#@ me!" moments in
life.
PS to Microsoft: Did you really try this stuff out prior to shipping?
designer creating both data tables and related table adapters. For the most
part, the relationships between tables are automatically discovered and
rendered on the designer surface.
For my application, it is necessary to change each SELECT, UPDATE, INSERT
and DELETE statement to customize the handling of timestamps (TS --> CAST(TS
AS INT) AS TS), concurrency conflict handling and retrieving the
autoincrement keys. OK - that's fine but somewhat painful (i.e., labor
intensive [12 tables * 4 sql statements]).
Switching from SQL Server 2000 to SQL Server 2005, you go from a table owner
to schema name metaphor. For example, dbo.OfficeType becomes
AgentNET.OfficeType where dbo is the owner (in 2000) and AgentNET is the
schema (in 2005).
Making the change in the designer should be relatively simple by changing
the underlying SQL statements as in:
SELECT OfficeTypeID, OfficeType, Description, ListOrder, CAST(TS AS INT) AS
TS FROM dbo.OfficeType
SELECT OfficeTypeID, OfficeType, Description, ListOrder, CAST(TS AS INT) AS
TS FROM AgencyNET.OfficeType
However, the designer appears to have screwed up the relationships between
tables preventing the application from working. The only fix was to delete
the xsd file and start over from scratch!
The dataset is a disconnected container for holding a subset of the data on
the desktop. The table adapter is not part of the dataset - it is a wrapper
to the data adapter that handles CRUD (create, read, update, delete)
operations. Combining both dataset and adapters clouds the distinction.
Using the designer, changing where the data comes from breaks the container.
For my development, I'm going back to having one container (xsd) for the
dataset with no table adapters and a separate container for the data
adapters. That way, the backend can be changed without breaking the rest of
the application. So much for dragging tables to designer surface ever
again.
This was definitely one of those "You've got to be **#&$*#@ me!" moments in
life.
PS to Microsoft: Did you really try this stuff out prior to shipping?