Solved

READING  UNCOMMITTED SAVE TO DATATABLE

Posted on 2011-02-12
6
390 Views
Last Modified: 2012-05-11
Hi All,

In the middle of inserting data, I want to read that uncommitted table to get another data and store it to datatable.

Private functio Read_Uncommitted_Table(TrsId as string, _
                                                          cmdSQLCommand as sqlcommand) as datatable
   
    dim dtTable as datatable

    return dtTable
End Sub

How could I do it ?

Thank you.

0
Comment
Question by:emi_sastra
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:s_chilkury
Comment Utility
This has nothing to do with VB.Net. You sql query which fetches the records from the table has to be written such that it will bring uncommitted data from the DB.

The SP which fetches the records should have the following statement at the start of the batch statements:

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
0
 
LVL 1

Author Comment

by:emi_sastra
Comment Utility
Hi s_chilkury,

Could set it using vb code at the Read_Uncommitted_Table function ?

Thankyou.
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Are you using stored procedure or text command? If text command, then try this

sqlcmd.CommandText = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; Select ..."
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Author Comment

by:emi_sastra
Comment Utility
Hi CodeCruiser,

I use text command.

Which one is better, Isolation Level or Read With (NoLock) ?
And Why ?

Thank you.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
0
 
LVL 1

Author Comment

by:emi_sastra
Comment Utility
Ok.

Thank you very much for your help.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now