CREATE PROC proc_UpdateOldBalance(@RegistrationNumber char(8), @BalanceAmount bigint) as Declare @RowCount int SELECT @RowCount = COUNT(*) FROM OldBalance Where RegistrationNumber=@RegistrationNumber if (@rowCount<1) BEGIN PRINT 'You can not Update data. RegistrationNumber not available' ROLLBACK TRANSACTION END else update oldBalance set BalanceAmount = @BalanceAmount where RegistrationNumber=@RegistrationNumber return
try Dim mycom As SqlCommand = New SqlCommand("proc_UpdateOldBalance", ConnObj, transction) mycom.CommandType = CommandType.StoredProcedure mycom.Parameters.AddWithValue("@RegistrationNumber", txtRegistrationNo.Text) mycom.Parameters.AddWithValue("@BalanceAmount", txtBalanceRemain.Text) mycom.ExecuteNonQuery() transction.Commit() Catch sqlError As SqlException transction.Rollback() MessageBox.Show("Unable to deposit Fees" + System.Environment.NewLine + "Please contact Your Software Provider", "Payment Error", MessageBoxButtons.OK, MessageBoxIcon.Information) MessageBox.Show(Convert.ToString(sqlError)) Exit Sub End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)