From: Bart on
Hi,

i have a gridview which is updateble, using UpdateCommand="UPDATE myfile
set ....
Now i wonder whether i should use the property
'OldValuesParameterFormatString'.
When is it recommended and when not?
Thanks
Bart


From: Alexey Smirnov on
On Apr 25, 10:31 pm, " Bart" <bart(a)nospam> wrote:
> Hi,
>
> i have a gridview which is updateble,  using UpdateCommand="UPDATE myfile
> set ....
> Now i wonder whether i should use the property
> 'OldValuesParameterFormatString'.
> When is it recommended and when not?
> Thanks
> Bart

This property is used to include the original value of the parameter
(for example, when it is a primary key @id, "UPDATE myfile ..... WHERE
id=(a)id" and @id can be changed by the user)

You would need it in two following scenarios:

- If, when editing a record, users are able to change the primary key
value. In this case, both the new primary key value and the original
primary key value must be provided so that the record with the
original primary key value can be found and have its value updated
accordingly.

- When using optimistic concurrency. Optimistic concurrency is a
technique to ensure that two simultaneous users don't overwrite one
another's changes, and is the topic for a future tutorial.

More at http://www.asp.net/LEARN/data-access/tutorial-16-vb.aspx

Hope this helps
From: Bart on
thanks
"Alexey Smirnov" <alexey.smirnov(a)gmail.com> schreef in bericht
news:a8aeca47-4884-45bb-91ba-99303d3403dd(a)z11g2000yqz.googlegroups.com...
On Apr 25, 10:31 pm, " Bart" <bart(a)nospam> wrote:
> Hi,
>
> i have a gridview which is updateble, using UpdateCommand="UPDATE myfile
> set ....
> Now i wonder whether i should use the property
> 'OldValuesParameterFormatString'.
> When is it recommended and when not?
> Thanks
> Bart

This property is used to include the original value of the parameter
(for example, when it is a primary key @id, "UPDATE myfile ..... WHERE
id=(a)id" and @id can be changed by the user)

You would need it in two following scenarios:

- If, when editing a record, users are able to change the primary key
value. In this case, both the new primary key value and the original
primary key value must be provided so that the record with the
original primary key value can be found and have its value updated
accordingly.

- When using optimistic concurrency. Optimistic concurrency is a
technique to ensure that two simultaneous users don't overwrite one
another's changes, and is the topic for a future tutorial.

More at http://www.asp.net/LEARN/data-access/tutorial-16-vb.aspx

Hope this helps