How to use RowVersion with TableAdapters
How to use RowVersion with TableAdapters
Hey
I do use the new v4 of mySQL.NET drivers. - After some trying around, I decided to use tableAdapters with DataSets & the DataSet wizzard.
So, I create a network application and now want to know, how I can use a rowversion (timestamp) to see, if the Data has been changed since the client got it on his screen.
Hope you can help me - THX
I do use the new v4 of mySQL.NET drivers. - After some trying around, I decided to use tableAdapters with DataSets & the DataSet wizzard.
So, I create a network application and now want to know, how I can use a rowversion (timestamp) to see, if the Data has been changed since the client got it on his screen.
Hope you can help me - THX
You should create table with TIMESTAMP field, then in DataSet Wizard configure update command in data adapter (press 'Configure' button at the 'Setup Individual Tables' page to show 'Table Adapter Editor' dialog) and select the key field and timestamp field as updating fields ('Command generator' tab).
Table example:Generated update command example:
Table example:
Code: Select all
CREATE TABLE row_version (
id INT(11) AUTO_INCREMENT,
value VARCHAR(20) DEFAULT NULL,
version TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
)
Code: Select all
UPDATE `row_version` SET `id` = :id, `value` = :value, `version` = :version WHERE ((`id` = :Original_id) AND (`version` = :Original_version))
Hey
THX! - This sounds great
I have installed Vista on my PC. - Now I have the problem, that after using the DataSet Wizzard and try to drag/drop a database to my form, NO TableAdapter & No code is generated. - I also can not find a TableAdapter. What can be the problem? AND where to find the TableAdapter to set by manual?
THX! - This sounds great
I have installed Vista on my PC. - Now I have the problem, that after using the DataSet Wizzard and try to drag/drop a database to my form, NO TableAdapter & No code is generated. - I also can not find a TableAdapter. What can be the problem? AND where to find the TableAdapter to set by manual?
DataSet Wizard uses MySqlDataSetGenerator custom tool by default (see 'Use provider-specific code generator' option on the 'Select DataSet' page). This tool generates configured MySqlDataSet and MySqlDataTable descendants, not TableAdapters.
To change this behaviour, uncheck option I've pointed or manually set the 'Custom Tool' option of .xsd file to 'MSDataSetGenerator' value. Classes will be automatically regenerated and TableAdapters will be created. Note that in this case you will not be able to use MySqlDataSet and MySqlDataTable features.
To change this behaviour, uncheck option I've pointed or manually set the 'Custom Tool' option of .xsd file to 'MSDataSetGenerator' value. Classes will be automatically regenerated and TableAdapters will be created. Note that in this case you will not be able to use MySqlDataSet and MySqlDataTable features.