I'm testing out the sqltransaction and everything was working fine but when I tried opening another connection to read the record before the values are commited, it seems to be locked even though I set the isolationlevel for the transaction to be ReadUncommited.

The result is the program will hang when the second connection tries to read from the same record that was being updated by the transaction.

If there any way to get around this? I want to be able to at least read the uncommited changes.

Code:
        Dim cn As New SqlClient.SqlConnection(strCn)

        Dim cn2 As New SqlClient.SqlConnection(strCn)

        cn.Open()
        cn2.Open()

        Dim cmd As New SqlClient.SqlCommand()
        Dim tran As SqlClient.SqlTransaction = cn.BeginTransaction(IsolationLevel.ReadUncommitted)
        MsgBox(tran.IsolationLevel.ToString)

        cmd.CommandType = CommandType.Text
        cmd.Transaction = tran
        cmd.CommandText = "INSERT INTO [Sales] (ItemNo,TransNo,Quantity) VALUES (1,1,10)"
        cmd.Connection = cn
        cmd.ExecuteNonQuery()

        cmd.CommandText = "UPDATE [Stock] SET Quantity=Quantity-10 WHERE ItemNo=1"
        cmd.ExecuteNonQuery()

        Dim cmd2 As New SqlClient.SqlCommand()
        cmd2.CommandType = CommandType.Text
        cmd2.Connection = cn2
        cmd2.CommandText = "SELECT * FROM [Stock] WHERE ItemNo=1"