Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2005, 01:20 AM
Authorized User
Points: 173, Level: 3
Points: 173, Level: 3 Points: 173, Level: 3 Points: 173, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default SELECT with READPAST doesn't work !

Hi all,

I've written a multiuser software in VB.NET using ADO.NET and MSSQL Server 2000.

User #1 performs a
SELECT ... FROM Table1 WITH (ROWLOCK)... ,

the connection of User #1 being

cnx = New SqlConnection(SetConString(10))
cnx.Open()
trx = cnx.BeginTransaction(IsolationLevel.Serializable)

da = New SqlDataAdapter(Sca, cnx)
da.SelectCommand.Transaction = trx
da.Fill(ds, "TabDetails")
...

At the same time, User #2 does a
SELECT ... FROM Table1 WITH (READPAST) ....the connection of User #2 being

[blue]cnx = New SqlConnection(SetConString(10))
cnx.Open()
trx = cnx.BeginTransaction(IsolationLevel.ReadCommitted)

da = New SqlDataAdapter(sSQL, cnx)
da.SelectCommand.Transaction = trx
da.Fill(ds, "TabSursa")
...
cnx, trx being the connection and transaction, respectively.

Connection of User #1 is open a long time, much longer than that of User #2.

The problem : Row locking does work, but not READPAST.

User #2 still sees the record (row) that User #1 has accessed, although the row is locked (I tried to access it and it doesn't work, which is what SQL Server should do), and although the SELECT of User #2 has the READPAST hint.

???

Mike
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
Select from another select statement to a repeater simsen ASP.NET 2.0 Professional 0 May 2nd, 2007 04:34 PM
Fill select box and select recordset value markd Classic ASP Databases 1 February 20th, 2006 06:41 PM
READPAST Hint in SELECT statement won't work mike_abc SQL Server 2000 0 June 29th, 2005 08:08 AM
select="node1", select="node2"... Baldo XSLT 7 March 12th, 2004 10:38 AM



All times are GMT -4. The time now is 02:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.