Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do u implement locking concept for dataset?

Answer Posted / akash

One way to work around optimistic concurrency issues in ADO
is to lock the records your DataSet retrieves as soon as
the edit operation begins. This strategy is known as
pessimistic locking. Long-duration locks generally lead to
poor database performance and contention problems, but in
situations where an application cannot tolerate having
records changed while it is updating them, pessimistic
locking may be necessary.

With ADO, it's relatively easy to use a pessimistic locking
scheme. In ADO.NET, it's somewhat more difficult to set up,
but you can still use pessimistic locking in your
applications. However, just because you can do something
doesn’t mean you should do it all the time—what I’m about
to explain should be used only when absolutely necessary.


The basics steps for pessimistic locking are as follows:

1)Create a transaction with an IsolationLevel of
RepeatableRead.

2)Set the DataAdapter’s SelectCommand property to use the
transaction you created.

3)Make the changes to the data.

4)Set DataAdapter’s Insert, Update, and Delete command
properties to use the transaction you created.

5)Call the DataAdapter’s Update method.

6)Commit the transaction.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of using ado.net?

1050


What is an example of ordinal data?

1236


What does adodb stand for?

1129


The answers which posted above is not satisfied my requirement? Can some one post teh exact answer? Thanx

2080


Why is it important to close an ado.net application?

1072


Define data adapter?

1020


What are the advantages of oledb compared with other classes?

2840


How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

1085


What Is Difference Between Ado And Ado.net?

1076


Define partial class?

1026


What is the use of SqlCommand object?

1285


What are the drawbacks of using ado.net?

1012


What is sqldatareader in ado.net?

966


Which method in OLEDBAdapter is used to populate dataset with records?

1069


List all the steps in order, to access a database through ado.net?

1123