GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  VB.NET
Go To First  |  Previous Question  |  Next Question 
 VB.NET  |  Question 13 of 60    Print  
How VB Implements the Disonnected Architecture as like VB.Net?

  
Total Answers and Comments: 3 Last Update: February 05, 2007     Asked by: srinivasan111 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 15, 2006 06:09:27   #1  
Leo        

RE: How VB Implements the Disonnected Architecture as ...
Well by intorducing a conceot called dataset.....which lies between database and datagrid or whatever ...your component is ....
 
Is this answer useful? Yes | No
June 17, 2006 11:09:58   #2  
kanwal_hans Member Since: March 2006   Contribution: 2    

RE: How VB Implements the Disonnected Architecture as ...
In VB to implement a disconnected recordset after you have filled the recordset with the data set its active connection property to Nothing . That breaks the connection to the database.You can locally also save the data of the recordset by using its Save function.
 
Is this answer useful? Yes | No
February 05, 2007 02:48:03   #3  
avkdsiva Member Since: June 2006   Contribution: 9    

RE: How VB Implements the Disonnected Architecture as ...
You can implement Disconnected architecture by changing the cursor location property of Recordset to 3 (adUseClient)Set myRS new ADODB.RecordsetmyRS.CursorLocation adUseClientThis recordset is used as a disconnected recordset. That means when you open the recordset with a query the records are fetched into it. Then you need to set the active connection to nothing which means the recordset is disconnected. Below is an exampleDim myConn As ADODB.myConnectionDim myRs As ADODB.Recordset' Create instance of myConnection object and then open the' myConnection.Set myConn New ADODB.myConnectionmyConn.Open DSN SQLServer sa ' Create instance of recordset object and open the' recordset object against a table.Set myRs New ADODB.Recordset' Setting the cursor location to client side is important' to get a dismyConnected recordset.myRs.CursorLocation adUseClientmyRs.Open Select * from Table1 _ myConn _ ADODB.adOpenForwardOnly _ ADODB.adLockBatchOptimistic' DismyConnect the recordset.Set myRs.ActivemyConnection Nothing' Get the value of one of the fields from the recordset' after dismyConnection.Dim vv myRs.Fields(0).ValueMsgBox vmyConn.Close' Get the value of one of the fields from the recordset' after closing the myConnection to ensure that you have a' dismyConnected recordset.v myRs.Fields(0).ValueMsgBox (v)' Now edit the value and save it.myRs.Fields( au_lname ).Value NewValue ' Now reopen the myConnection and attach it to the recordset. UpdateSet myConn New ADODB.myConnectionmyConn.Open DSN DBSql sa myRs.ActivemyConnection myConnmyRs.UpdateBatchmyRs.ClosemyConn.CloseSet myRs NothingSet myConn Nothing
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape