How do u implement locking concept for dataset?

Answer Posted / ananthi.r

When we update , the DataSet helps out with the process,
because it keeps track of multiple versions of rows that
have been updated. You can use parameters to set the
CommandText property of DataAdapter's UpdateCommand. The
SqlParameter class contains a property, called RowVersion,
that informs the DataSet which version of the value to make
use of. The DataAdapter judges whether the update worked by
considering whether the UPDATE statement have an effect on
zero or a non-zero number of rows. If someone else has
changed design (or deleted the row), the UPDATE returns "0
rows affected." If no one else touched the row (that is,
your optimism was justified), you receive "1 row affected."

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default timeout specified for "sqlcommand.commandtimeout" property?

535


What is command class in ado.net?

469


What is sqldatasource?

517


Which database is the ado.net sql connection object designed for?

582


What is data reader in ado.net?

494






What is meant by executenonquery?

522


Explain the difference between sqlcommand object and command behavior object?

529


What is linq and entity framework?

510


What are all the classes that are available in System.Data Namespace?

548


What are disadvantages of microsoft-provided data provider classes in ado.net?

496


How to maintain the relation between two tables in ADO.NET?

532


How to load multiple tables into a dataset?

534


How do I delete a row from a DataTable?

587


Explain ado.net features?

530


Why do we use sqldataadapter?

475