asp.net 刪除,更新數(shù)據(jù)庫(kù)方法
來(lái)源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-27 22:44:13
asp.net 刪除,更新數(shù)據(jù)庫(kù)方法
asp.net 刪除,更新數(shù)據(jù)庫(kù)方法: 代碼如下:'數(shù)據(jù)更新 Public Sub updateTable(ByVal StrSql As String) objCommand.CommandText = StrSql Try conSql.Open() Trans = conSql.BeginTransaction objCommand.Transaction = Trans objC
導(dǎo)讀asp.net 刪除,更新數(shù)據(jù)庫(kù)方法: 代碼如下:'數(shù)據(jù)更新 Public Sub updateTable(ByVal StrSql As String) objCommand.CommandText = StrSql Try conSql.Open() Trans = conSql.BeginTransaction objCommand.Transaction = Trans objC
代碼如下:
'數(shù)據(jù)更新
Public Sub updateTable(ByVal StrSql As String)
objCommand.CommandText = StrSql
Try
conSql.Open()
Trans = conSql.BeginTransaction
objCommand.Transaction = Trans
objCommand.ExecuteNonQuery()
Trans.Commit()
Catch ese As Exception
MsgBox(ese.Message)
Trans.Rollback() '如果更新異常則取消所有更新
Finally
conSql.Close() '關(guān)閉連接
End Try
End Sub
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
asp.net 刪除,更新數(shù)據(jù)庫(kù)方法
asp.net 刪除,更新數(shù)據(jù)庫(kù)方法: 代碼如下:'數(shù)據(jù)更新 Public Sub updateTable(ByVal StrSql As String) objCommand.CommandText = StrSql Try conSql.Open() Trans = conSql.BeginTransaction objCommand.Transaction = Trans objC