Big Red
02-03-2009, 12:26 PM
(using vb.net) On our intranet site we have an app that loads customer or vendor information and then allows the users to edit info and add/update/delete contacts. I'm not sure what really changed to this program lately, but I keep getting this error:
Method not found: 'Int16 DBLayer.DBTools.ExecuteNonQuery(System.String, DB)'.
This occurs when i try editing any customer info and the vendor contacts, but the program works when I try editing the vendor info/addy. Here's the program code. There's a seperate program on our webserver that contains the classes used. Here's the main code that calls the classes:
TO ADD CONTACT
M2MInterface.M2M.Customers.AddContact(Session("CustVendID"), txtFName.Text.ToUpper.Trim, txtLName.Text.ToUpper.Trim, Tools.RemovePhoneNumberFormat(Phone), Tools.RemovePhoneNumberFormat(Fax), txtEMail.Text, txtNotes.Text, False)
TO UPDATE CONTACT
M2MInterface.M2M.Customers.UpdateContact(PID, txtFName.Text.ToUpper.Trim, txtLName.Text.ToUpper.Trim, Tools.RemovePhoneNumberFormat(Phone), Tools.RemovePhoneNumberFormat(Fax), txtEMail.Text, txtNotes.Text, False)
TO UPDATE CUSTOMER ADDRESS/INFO
objCust.Save()
TO UPDATE VENDOR ADDRESS/INFO
objVend.Save()
Here's the classes (remember the objVend.Save() seems to be working while the others are not)
ADD CONTACT
Public Shared Function AddContact(ByVal CustNo As String, ByVal FName As String, ByVal LName As String, ByVal Phone As String, ByVal Fax As String, ByVal EMail As String, ByVal Notes As String, ByVal MailingList As Boolean) As String
Dim mlist As String
If MailingList = True Then
mlist = "1"
Else
mlist = "0"
End If
DBTools.ExecuteNonQuery("insert into vDWSYPHON ( FCFAX, FCNUMBER, FCFNAME, FCONTACT, FCEMAIL, FMNOTES, fcsourceid, fcs_alias, fcclass) values('" & Fax & "', '" & Phone & "', '" & FName & "', '" & LName & "', '" & EMail & "', '" & Notes & "', '" & CustNo & "', 'SLCDPM', 'WP')", DBTools.DB.M2M)
Dim pid As String = DBTools.ExecuteScalar("select max(Identity_Column) from SYPHON", DBTools.DB.M2M)
DBTools.ExecuteNonQuery("insert into SYPHON_EXT (FIELD0, FKey_ID) values(" & mlist & ", '" & pid & "')", DBTools.DB.M2M)
Return pid
End Function
UPDATE CONTACT
Public Shared Sub UpdateContact(ByVal PID As String, ByVal FName As String, ByVal LName As String, ByVal Phone As String, ByVal Fax As String, ByVal EMail As String, ByVal Notes As String, ByVal MailingList As Boolean)
Dim mlist As String
If MailingList = True Then
mlist = "1"
Else
mlist = "0"
End If
DBTools.ExecuteNonQuery("Update vDWSYPHON Set FCFAX = '" & Fax & "', fcnumber = '" & Phone & "', fcfname = '" & FName & "', fcontact = '" & LName & "', fcemail = '" & EMail & "', fmnotes = '" & Notes & "' where identity_column = '" & PID & "'", DBTools.DB.M2M)
DBTools.ExecuteNonQuery("Update SYPHON_EXT Set FIELD0=" & mlist & " where FKey_ID = '" & PID & "'", DBTools.DB.M2M)
End Sub
SAVE CUSTOMER (part of the function)
Public Function Save(Optional ByVal site As String = "") As String
'Public Function Save() As String
Dim sql As String = ""
Dim notes As String = ""
'Dim site As String = ""
Dim flag As String = site
'main table
'Try
If locCustNo = -1 Then
'get next cust no
locCustNo = Customers.GetNextCustomerNo()
'insert into main table
If site = "1" Then
'Customer is signing up through the Labs Done Fast website
notes = "Labs Done Fast sign up customer"
ElseIf site = "2" Then
'Customer is signing up through the Diversified Website
notes = "Web site sign up customer"
Else
notes = ""
End If
sql = "insert into SLCDPM (fcustno, fcompany, fcity, fphone, fcfname, fcontact, fcountry, fcreated, fcrlimit, fcshipto, fcsoldto, ffax, ffob, fpaytype, fstate, ftype, fzip, fcstatus, fcemail, fmnotes, fmstreet, FTERM, FSALESPN, FUSERCODE) values('" & locCustNo & "', '" & locCustName & "', '" & locBillCity & "', '" & DWITools.Tools.RemovePhoneNumberFormat(locMainPhone) & "', '" & locPrimContFName & "', '" & locPrimContLName & "', 'United States', '" & Today.ToShortDateString & "', '500000', '0001', '0001', '" & DWITools.Tools.RemovePhoneNumberFormat(locMainFax) & "', 'Suring', '3', '" & locBillState & "', '" & locM2MCustType.ToString & "', '" & DWITools.Tools.RemoveZipCodeFormat(locBillZip) & "', '" & locStatus & "', '" & locMainEmail & "', '" & notes & "', '" & locBillStreet & "', '" & locNetTerms & "', '" & locSalesPerson & "', '" & locSalesCode & "')"
DBTools.ExecuteNonQuery(sql, DBLayer.DBTools.DB.M2M)
'get new id col for record
sql = "select max(identity_column) from SLCDPM"
locSLCDPMIDCol = DBTools.ExecuteScalar(sql, DBLayer.DBTools.DB.M2M)
Else
'update record
sql = "update SLCDPM set fcompany = '" & locCustName & "', fcity = '" & locBillCity & "', fphone = '" & DWITools.Tools.RemovePhoneNumberFormat(locMainPhone) & "', fcfname = '" & locPrimContFName & "', fcontact = '" & locPrimContLName & "', ffax = '" & DWITools.Tools.RemovePhoneNumberFormat(locMainFax) & "', fstate = '" & locBillState & "', fzip = '" & DWITools.Tools.RemoveZipCodeFormat(locBillZip) & "', fcemail = '" & locMainEmail & "', fmstreet = '" & locBillStreet & "', fcstatus='" & locStatus & "', fTerm='" & locNetTerms & "', FSALESPN='" & locSalesPerson & "', FUSERCODE='" & locSalesCode & "' where fcustno = '" & locCustNo & "'"
DBTools.ExecuteNonQuery(sql, DBLayer.DBTools.DB.M2M)
End If
end sub
SAVE VENDOR (works in program)
Public Sub Save()
DT.Rows(0).Item("FCOMPANY") = Me.locVendName
DT.Rows(0).Item("FMSTREET") = Me.locStreet
DT.Rows(0).Item("FCITY") = Me.locCity
DT.Rows(0).Item("FSTATE") = Me.locState
DT.Rows(0).Item("FZIP") = Me.locZip
DT.Rows(0).Item("FPhone") = Me.locMainPhone
DT.Rows(0).Item("FFax") = Me.locMainFax
DT.Rows(0).Item("FCEMAIL") = Me.locMainEmail
DT.Rows(0).Item("fcfname") = Me.locPrimContFName
DT.Rows(0).Item("fcontact") = Me.locPrimContLName
DT.Rows(0).Item("FMuser1") = Me.locNotes
DA.Update(DT)
End Sub
any help on this or ideas would be greatly appreciated because I'm a bit lost as to what to do or try right now! Let me know if any other information or code is needed. Thanks!
Method not found: 'Int16 DBLayer.DBTools.ExecuteNonQuery(System.String, DB)'.
This occurs when i try editing any customer info and the vendor contacts, but the program works when I try editing the vendor info/addy. Here's the program code. There's a seperate program on our webserver that contains the classes used. Here's the main code that calls the classes:
TO ADD CONTACT
M2MInterface.M2M.Customers.AddContact(Session("CustVendID"), txtFName.Text.ToUpper.Trim, txtLName.Text.ToUpper.Trim, Tools.RemovePhoneNumberFormat(Phone), Tools.RemovePhoneNumberFormat(Fax), txtEMail.Text, txtNotes.Text, False)
TO UPDATE CONTACT
M2MInterface.M2M.Customers.UpdateContact(PID, txtFName.Text.ToUpper.Trim, txtLName.Text.ToUpper.Trim, Tools.RemovePhoneNumberFormat(Phone), Tools.RemovePhoneNumberFormat(Fax), txtEMail.Text, txtNotes.Text, False)
TO UPDATE CUSTOMER ADDRESS/INFO
objCust.Save()
TO UPDATE VENDOR ADDRESS/INFO
objVend.Save()
Here's the classes (remember the objVend.Save() seems to be working while the others are not)
ADD CONTACT
Public Shared Function AddContact(ByVal CustNo As String, ByVal FName As String, ByVal LName As String, ByVal Phone As String, ByVal Fax As String, ByVal EMail As String, ByVal Notes As String, ByVal MailingList As Boolean) As String
Dim mlist As String
If MailingList = True Then
mlist = "1"
Else
mlist = "0"
End If
DBTools.ExecuteNonQuery("insert into vDWSYPHON ( FCFAX, FCNUMBER, FCFNAME, FCONTACT, FCEMAIL, FMNOTES, fcsourceid, fcs_alias, fcclass) values('" & Fax & "', '" & Phone & "', '" & FName & "', '" & LName & "', '" & EMail & "', '" & Notes & "', '" & CustNo & "', 'SLCDPM', 'WP')", DBTools.DB.M2M)
Dim pid As String = DBTools.ExecuteScalar("select max(Identity_Column) from SYPHON", DBTools.DB.M2M)
DBTools.ExecuteNonQuery("insert into SYPHON_EXT (FIELD0, FKey_ID) values(" & mlist & ", '" & pid & "')", DBTools.DB.M2M)
Return pid
End Function
UPDATE CONTACT
Public Shared Sub UpdateContact(ByVal PID As String, ByVal FName As String, ByVal LName As String, ByVal Phone As String, ByVal Fax As String, ByVal EMail As String, ByVal Notes As String, ByVal MailingList As Boolean)
Dim mlist As String
If MailingList = True Then
mlist = "1"
Else
mlist = "0"
End If
DBTools.ExecuteNonQuery("Update vDWSYPHON Set FCFAX = '" & Fax & "', fcnumber = '" & Phone & "', fcfname = '" & FName & "', fcontact = '" & LName & "', fcemail = '" & EMail & "', fmnotes = '" & Notes & "' where identity_column = '" & PID & "'", DBTools.DB.M2M)
DBTools.ExecuteNonQuery("Update SYPHON_EXT Set FIELD0=" & mlist & " where FKey_ID = '" & PID & "'", DBTools.DB.M2M)
End Sub
SAVE CUSTOMER (part of the function)
Public Function Save(Optional ByVal site As String = "") As String
'Public Function Save() As String
Dim sql As String = ""
Dim notes As String = ""
'Dim site As String = ""
Dim flag As String = site
'main table
'Try
If locCustNo = -1 Then
'get next cust no
locCustNo = Customers.GetNextCustomerNo()
'insert into main table
If site = "1" Then
'Customer is signing up through the Labs Done Fast website
notes = "Labs Done Fast sign up customer"
ElseIf site = "2" Then
'Customer is signing up through the Diversified Website
notes = "Web site sign up customer"
Else
notes = ""
End If
sql = "insert into SLCDPM (fcustno, fcompany, fcity, fphone, fcfname, fcontact, fcountry, fcreated, fcrlimit, fcshipto, fcsoldto, ffax, ffob, fpaytype, fstate, ftype, fzip, fcstatus, fcemail, fmnotes, fmstreet, FTERM, FSALESPN, FUSERCODE) values('" & locCustNo & "', '" & locCustName & "', '" & locBillCity & "', '" & DWITools.Tools.RemovePhoneNumberFormat(locMainPhone) & "', '" & locPrimContFName & "', '" & locPrimContLName & "', 'United States', '" & Today.ToShortDateString & "', '500000', '0001', '0001', '" & DWITools.Tools.RemovePhoneNumberFormat(locMainFax) & "', 'Suring', '3', '" & locBillState & "', '" & locM2MCustType.ToString & "', '" & DWITools.Tools.RemoveZipCodeFormat(locBillZip) & "', '" & locStatus & "', '" & locMainEmail & "', '" & notes & "', '" & locBillStreet & "', '" & locNetTerms & "', '" & locSalesPerson & "', '" & locSalesCode & "')"
DBTools.ExecuteNonQuery(sql, DBLayer.DBTools.DB.M2M)
'get new id col for record
sql = "select max(identity_column) from SLCDPM"
locSLCDPMIDCol = DBTools.ExecuteScalar(sql, DBLayer.DBTools.DB.M2M)
Else
'update record
sql = "update SLCDPM set fcompany = '" & locCustName & "', fcity = '" & locBillCity & "', fphone = '" & DWITools.Tools.RemovePhoneNumberFormat(locMainPhone) & "', fcfname = '" & locPrimContFName & "', fcontact = '" & locPrimContLName & "', ffax = '" & DWITools.Tools.RemovePhoneNumberFormat(locMainFax) & "', fstate = '" & locBillState & "', fzip = '" & DWITools.Tools.RemoveZipCodeFormat(locBillZip) & "', fcemail = '" & locMainEmail & "', fmstreet = '" & locBillStreet & "', fcstatus='" & locStatus & "', fTerm='" & locNetTerms & "', FSALESPN='" & locSalesPerson & "', FUSERCODE='" & locSalesCode & "' where fcustno = '" & locCustNo & "'"
DBTools.ExecuteNonQuery(sql, DBLayer.DBTools.DB.M2M)
End If
end sub
SAVE VENDOR (works in program)
Public Sub Save()
DT.Rows(0).Item("FCOMPANY") = Me.locVendName
DT.Rows(0).Item("FMSTREET") = Me.locStreet
DT.Rows(0).Item("FCITY") = Me.locCity
DT.Rows(0).Item("FSTATE") = Me.locState
DT.Rows(0).Item("FZIP") = Me.locZip
DT.Rows(0).Item("FPhone") = Me.locMainPhone
DT.Rows(0).Item("FFax") = Me.locMainFax
DT.Rows(0).Item("FCEMAIL") = Me.locMainEmail
DT.Rows(0).Item("fcfname") = Me.locPrimContFName
DT.Rows(0).Item("fcontact") = Me.locPrimContLName
DT.Rows(0).Item("FMuser1") = Me.locNotes
DA.Update(DT)
End Sub
any help on this or ideas would be greatly appreciated because I'm a bit lost as to what to do or try right now! Let me know if any other information or code is needed. Thanks!