paulthepaddy
Well-known member
hey Guys, what is the best 'Method' of confirming database stuff.
I was thinking of making a small form that would, display the rows edited, added,updated and so on.
purly on the off chance something gets 'Paid' that shouldn't get paid.
im not sure if i can use a data grid view as the data is going to be diffrent.
can anyone give me some suggestions?
and il try and fiure out the code myself (hopefully)
thanks guys
VB.NET:
Public Function Car_Paid(reg As String) As Boolean
Connection.Open()
Dim CARcommand As New OleDb.OleDbCommand("UPDATE cars SET Paid = true WHERE (Reg = @Reg)", Connection)
CARcommand.Parameters.AddWithValue("@Reg", reg)
CARcommand.ExecuteNonQuery()
Dim ODRCommand As New OleDb.OleDbCommand("SELECT Count(*) From OrderNumbers WHERE (Reg = @Reg)", Connection)
ODRCommand.Parameters.AddWithValue("@Reg", reg)
If CInt(ODRCommand.ExecuteScalar) > 0 Then
ODRCommand = New OleDb.OleDbCommand("UPDATE OrderNumbers SET Paid = True WHERE (Reg = @Reg)", Connection)
ODRCommand.Parameters.Clear()
ODRCommand.Parameters.AddWithValue("@Reg", reg)
ODRCommand.ExecuteNonQuery()
End If
Dim WDCommand = New OleDb.OleDbCommand("SELECT Count(*) From WorkDone WHERE Reg = @Reg", Connection)
WDCommand.Parameters.AddWithValue("@Reg", reg)
If CInt(WDCommand.ExecuteScalar) > 0 Then
WDCommand = New OleDb.OleDbCommand("UPDATE WorkDone SET Paid = True WHERE (Reg = @Reg)", Connection)
WDCommand.Parameters.AddWithValue("@Reg", reg)
WorkDone_da.UpdateCommand.ExecuteNonQuery()
End If
Connection.Close()
Return True
End Function
I was thinking of making a small form that would, display the rows edited, added,updated and so on.
purly on the off chance something gets 'Paid' that shouldn't get paid.
im not sure if i can use a data grid view as the data is going to be diffrent.
can anyone give me some suggestions?
and il try and fiure out the code myself (hopefully)
thanks guys