Dim Conn As SqlConnection = UW.SQL.GetOpenedConnection
Dim Tran As SqlTransaction = Conn.BeginTransactionTry
Dim C As Int32 = UW.SQL.GetSingleValue("Select Counter From TableA Where Id = 1", Tran)
C = C + 1
UW.SQL.executeSQL("Update TableA Set Counter = " & C & " Where Id = 1", Tran)
Tran.Commit()
Catch ex As Exception
Tran.Rollback()
UW.WU.DebugWriteLine(ex.ToString, True, True)Finally
If Conn.State <> ConnectionState.Closed Then
Conn.Close()
End IfEnd Try
Dim C As Int32 = UW.SQL.GetSingleValue("Select Counter From TableA Where Id = 1", Tran)
Dim C As Int32 = UW.SQL.GetSingleValue("Select Counter From TableA With(XLock) Where Id = 1", Tran)
USE AdventureWorks;
GO
CREATE INDEX IX_Address_PostalCode
ON Person.Address (PostalCode)
INCLUDE (AddressLine1, AddressLine2, City, StateProvinceID);
#region Configure for Content Provider =>區塊說明,在程式裡不會work
//Settings for Cotent Provider (for Alpha Enviroment)
string szCID = xmlDoc.DocumentElement["CID"].InnerText;
string szKey = "z1okwCmRSkgk/vkWzxIuwQNuUvf9d8gj";
string szIV = "dg454KArm6g=";
string szPassword = "1234";
#endregion