Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

READING  UNCOMMITTED SAVE TO DATATABLE

Posted on 2011-02-12
6
Medium Priority
?
398 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
ID: 34881143
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
ID: 34881148
Hi s_chilkury,

Could set it using vb code at the Read_Uncommitted_Table function ?

Thankyou.
0
 
LVL 83

Expert Comment

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

sqlcmd.CommandText = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; Select ..."
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:emi_sastra
ID: 34885034
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 2000 total points
ID: 34887115
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 34887314
Ok.

Thank you very much for your help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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 …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

885 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