G
Guest
Hello,
I'm trying to update some records of a database table called
"PETICIONS_TRESORERIA" with this structure:
codi int
data_peticio datetime
name varchar
(first two fields made the primary key)
..
..
..
I'm using a data adapter with a UpdateCommand as follows:
update PETICIONS_TRESORERIA set
codi=@codi,data_peticio=@data_peticio,name=@name where codi=@codi and
data_peticio=@data_peticio
The "SourceVersion" property for the UpdateCommand parameters @codi and
@data_peticio, are set to "DataRowVersion.Original", as if the user change
them on the associated datagrid , I want to return the original values for
changing them
An example will be more clear:
If I have these original values for codi, data_peticio and name :
1000,1/1/2007,Roger
And I change the "name" to other value, when I do the data adapter update,
it works perfect, but, if I change the code or data_peticio, nothing happens
(no errors, no update).
The same happens if I undo the definition of the primary key on the table.
What's the problem ?
Thanks in advance,
Roger Tranchez
..NET 2005 and DB developer
I'm trying to update some records of a database table called
"PETICIONS_TRESORERIA" with this structure:
codi int
data_peticio datetime
name varchar
(first two fields made the primary key)
..
..
..
I'm using a data adapter with a UpdateCommand as follows:
update PETICIONS_TRESORERIA set
codi=@codi,data_peticio=@data_peticio,name=@name where codi=@codi and
data_peticio=@data_peticio
The "SourceVersion" property for the UpdateCommand parameters @codi and
@data_peticio, are set to "DataRowVersion.Original", as if the user change
them on the associated datagrid , I want to return the original values for
changing them
An example will be more clear:
If I have these original values for codi, data_peticio and name :
1000,1/1/2007,Roger
And I change the "name" to other value, when I do the data adapter update,
it works perfect, but, if I change the code or data_peticio, nothing happens
(no errors, no update).
The same happens if I undo the definition of the primary key on the table.
What's the problem ?
Thanks in advance,
Roger Tranchez
..NET 2005 and DB developer