faiga16 - That opens up a can of worms. Besides, the characteristics of the ADO.NET model do not lend themselves to this kind of approach. Most data-driven technologies this days work in a disconnected mode, and do not persist (i.e. connect, get my records, build in-memory container, destroy connection).
If I am reading this right, Chenyuhao is trying to prevent a series of records from being modified while they are being edited by a user, through a user interface. The disconnected nature of .NET -and most other data-driven technologies these days make placing such controls on the database layer nearly impossible. Instead, a work-around would be to check-out these records or record by flagging them as uneditable or unavailable while the user has this form open and making changes. Effectively placing the responsability to avoid concurrency on the application. Much in the way that Source Safe or other content management tools allow for exclusive write-access to objects while checked-out by any one user.
Also, the XLOCK / ROWLOCK would only instate a row or table level lock while the query was running. Once the results are returned, the locks dissappear. And that won't server the purpose.