Solved

READING  UNCOMMITTED SAVE TO DATATABLE

Posted on 2011-02-12
6
393 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.net Move a class from Solution Items to a project 2 34
SQL LINE CONTINUATION ISSUE 12 38
VB.NET 2008 Publish Error 2 34
VB.NET Textbox input validation 4 41
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 …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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