I have a table with three columns that I need to display on a ASP.NET page. (SQL Server 2005, ASP.NET 2.0)
id int
value varchar(50)
tstamp timestamp
I use the timestamp field to handle concurrency validation so it's for internal use only and will never be displayed to the end user. But I need to store it somewhere in order to do proper updates.
Here's my update sproc.
UPDATE ValueTable SET value = @value
WHERE (id = @id) AND (tstamp = @tstamp)
SELECT @tstamp=tstamp FROM ValueTable
WHERE id=@id
I use a SqlDataSource to connect to my database and the schema has all three columns. My grid view will only display two fields since the timestamp field is hidden (Visible=False)
When I profile my asp page it looks like it doesn't store the timestamp anywhere even though I have a "hidden" field in the table.
How would you store a timestamp value in general on a web page? It should never be displayed, but it is needed for any updates.