0
我有一個VB.net CF應用程序連接到SQL 2008服務器。 我想實現事務,但是當我在事務開始時破壞我的代碼時,某些讀取查詢無法在表上完成。 例如,從表中選擇所有記錄,其中id爲<> 123 不會返回任何值。 但select * from stock將返回除正在處理的行之外的所有值。隔離級別不能在vb.net連接到SQL 2008 DB
Dim SQLComm As Data.SqlClient.SqlCommand
Dim myConnString As String = frmConnectionDetails.GetConnectionString
Dim SQLConn As New SqlConnection(myConnString)
Dim SQLTrans As SqlTransaction
SQLConn.Open()
SQLTrans = SQLConn.BeginTransaction(Data.IsolationLevel.ReadCommitted)
SQLComm = New SqlCommand
SQLComm.Connection = SQLConn
SQLComm.Transaction = SQLTrans
AddOrUpdateStock(objStock, SQLConn, SQLComm)
-Break here