ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ADO.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
How do u implement locking concept for dataset?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How do u implement locking concept for dataset?
Answer
# 1
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 ?    1 Yes 0 No
Ananthi.r
 
  Re: How do u implement locking concept for dataset?
Answer
# 2
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 ?    0 Yes 0 No
Akash
 
 
 

 
 
 
Other ADO.NET Interview Questions
 
  Question Asked @ Answers
 
Where do you store connection string ? Digital-GlobalSoft1
How do u implement locking concept for dataset? ABC2
What is the main difference between ADO and ADO.Net  3
Explain acid properties?  1
What?s the role of the DataReader class in ADO.NET connections? Ksb5
what is the criteria of selection in sbi interview? SBI1
ADO and ADO.NET differences ? Microsoft2
What is the Magic Tables in Sqlserver2000? SQL-Star4
What are relation objects in dataset and how & where to use them?  1
what are the differences between dataset and datareader? Choice-Solutions2
How can you implement sub data grid in a master datagrid?  1
What is the difference between oledbreader and datasetwhile connecting?  1
what is the syntax code for oldb to connect oracle IBM2
If a dataset contains 100 rows, how to fetch rows between 10 and 20 only ? Ksb10
How to check if a datareader is closed or opened?  1
Differences between dataset.clone and dataset.copy? Ksb1
Difference between DataReader and DataAdapter / DataSet and DataAdapter? TCS2
What happens when we issue Dataset.ReadXml command?  1
What is dataset and tell about its features. What are equivalent methods of previous, next etc. Of ADO in ADO.NET ? Digital-GlobalSoft1
How do you sort the data in datagrid? Choice-Solutions3
 
For more ADO.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com