Db_SQL.BeginTrans If Len(lblSerialNo.Caption) > 1 Then Db_SQL.Execute strSql ''excute a store-procedure for insert data into mastertable For i = 1 To dataGrid.rows - 1 Db_SQL.Execute strSql ''excute a store-procedure for insert data into detailstable Next Db_SQL.CommitTrans Else Dim adorstTemp As New ADODB.Recordset adorstTemp.CursorLocation = adUseClient adorstTemp.Open "select Slno from tblSLno",Db_SQL, adOpenStatic, adLockOptimistic, adCmdText mlngServiceSlno = CLng(adorstTemp("Slno ")) + 1 Db_SQL.Execute strSql ''Update data by StoreProcedure For i = 1 To dataGrid.rows - 1 Db_SQL.Execute strSql ''excute a store-procedure for insert data into detailstable Next If Condition true then Db_SQL.Execute strSql end if adorstTemp("Slno") = mlngServiceSlno adorstTemp.Update adorstTemp.Close Db_SQL.CommitTrans End if
.CommitTrans
.RollbackTrans
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)