should i use property 'OldValuesParameterFormatString'?

B

Bart

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
 
G

Guest

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=@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
 
B

Bart

thanks
"Anon User" <> schreef in bericht
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=@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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top