Posted on 2008-01-29
using VB.NET 05, I have implemented a form and some controls. I have some difficulties with the following function:
the class "DataValidator"
Public Shared Function InvoiceExists(ByVal search As frmSearch) As Boolean
Dim connection As OleDbConnection = GetConnection()
Dim countStatement As String
countStatement = "SELECT Count(BillsID) FROM Invoices WHERE studentID =?"
Dim countCommand As New OleDbCommand(countStatement, connection)
Dim searchCount As Integer = countCommand.ExecuteNonQuery
If searchCount > 0 Then
Catch ex As Exception
Even though, I enter an existing billsID, I still get a non existence message, from the following class "frmInvoice"
if DataValidator.InvoiceExists then
messageBox.show("hughbkihnnjnnkk, "non existence")
can you help me.