Hi,

I use VB.NET 2003 with SQL Server 2005.

I have a winform which is used to manage my "MEMBERS".

In that winform, I have many textboxes to display all the info regarding the membres and I have the buttons (Previous & Next).

Actually, when the user enters that screen, I fill a dataset with all the members in my database. I was doing this to make it easier when clicking on Previous & Next button, I only had to refer to my dataset to know the data and not requerying the DB everytimes.

But now I have to add a feature to lock the row I am displaying so another user can't modify it on his machine while it's in use.

With my big dataset, if I use a ROWLOCK when selecting, it is of course locking the whole table of members.

I guess I will have to forget about that big dataset and requery the database everytimes Previous & Next will be selected to only lock 1 row at a time.

--

Has anyone made something like this in the past ?

If the user wished to display member 3.

I do a "select fieldzzz from membres with rowlock where id = 3" to select and lock a specific member.

If I click on NEXT to display the member 4 .. how do I unlock the record id 3 ? .. will selecting the id 4 unlock the id 3 ?

--

All that rowlock thing is not so clear to me.
Thanks for helping or giving me link to very clear instructions ... cleared that SQL Server help itself.