solutionSeeker2
02-08-2009, 03:13 PM
Hi All,
I created a shopping cart using VB.NET and SQL Sever 2005, made several objects and their respective properties and methods. Everything goes fine on development machine.
The build always fails while publishing without errors in the error list but the Output window shows the following:
receipt.aspx.vb(62,0): error BC30456: 'updateCart' is not a member of 'cart'.
receipt.aspx.vb(63,0): error BC30456: 'OrderID' is not a member of 'cart'.
registration.aspx.vb(42,0): error BC30456: 'updateCart' is not a member of 'cart'.
shipping.aspx.vb(116,0): error BC30456: 'updateCart' is not a member of 'cart'.
signin.aspx.vb(37,0): error BC30456: 'ValidateCustomer' is not a member of 'cart'.
signin.aspx.vb(38,0): error BC30456: 'CustomerIdentity' is not a member of 'cart'.
signin.aspx.vb(39,0): error BC30456: 'FullName' is not a member of 'cart'.
signin.aspx.vb(40,0): error BC30456: 'CustomerStatus' is not a member of 'cart'.
signin.aspx.vb(42,0): error BC30456: 'updateCart' is not a member of 'cart'.
Where 'cart' is my self written object.
FYI I am pasting the code of 'cart' object below:
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class Cart
Private _custSession As String
Private _custId As Integer
Private _prodQty As Integer
Private _prodCost As Double
Private _isEmpty As Boolean
Private _fullName As String
Private _orderID As Integer
Private _orderSubmit As Boolean
Private _custStatus As Integer
Public customer As New Customer
Dim authPar() As SqlParameter
Public Property SessionID() As String
Get
Return _custSession
End Get
Set(ByVal value As String)
_custSession = value
End Set
End Property
Public Property CustomerIdentity() As Integer
Get
Return _custId
End Get
Set(ByVal value As Integer)
_custId = value
End Set
End Property
Public Property ProductQuantity() As Integer
Get
Return _prodQty
End Get
Set(ByVal value As Integer)
_prodQty = value
End Set
End Property
Public Property ProductPrice() As Double
Get
Return _prodCost
End Get
Set(ByVal value As Double)
_prodCost = value
End Set
End Property
Public Property HasItems() As Boolean
Get
Return _isEmpty
End Get
Set(ByVal value As Boolean)
_isEmpty = value
End Set
End Property
Public Property FullName() As String
Get
Return _fullName
End Get
Set(ByVal value As String)
_fullName = value
End Set
End Property
Public Property CustomerStatus() As Integer
Get
Return _custStatus
End Get
Set(ByVal value As Integer)
_custStatus = value
End Set
End Property
Public Property OrderID() As Integer
Get
Return _orderID
End Get
Set(ByVal value As Integer)
_orderID = value
End Set
End Property
Public Function ValidateCustomer(ByVal user As String, ByVal password As String, Optional ByVal id As Integer = 0) As Boolean
authPar = New SqlParameter(4) {}
authPar(0) = New SqlParameter("@loginid", SqlDbType.NVarChar, 50)
authPar(0).Direction = ParameterDirection.Input
authPar(0).Value = user
authPar(1) = New SqlParameter("@password", SqlDbType.NVarChar, 50)
authPar(1).Direction = ParameterDirection.Input
authPar(1).Value = password
.
.
.
.
.
authPar(4) = New SqlParameter("@customerStatus", SqlDbType.Int)
authPar(4).Direction = ParameterDirection.Output
DAL.verify(authPar)
If Not IsDBNull(authPar(2).Value) Then
CustomerIdentity = authPar(2).Value
FullName = authPar(3).Value
CustomerStatus = authPar(4).Value
ValidateCustomer = True
Else
ValidateCustomer = False
End If
End Function
Public Function updateCart(ByVal methodName As String, Optional ByVal prodID As Integer = 0, Optional ByVal prodQty As Integer = 0, Optional ByVal customerID As Integer = 0, Optional ByVal currentSession As String = "", Optional ByVal Prods As String = "", Optional ByVal Qtys As String = "", Optional ByVal prices As String = "", Optional ByVal shippingFName As String = "", Optional ByVal shippingLName As String = "", Optional ByVal shippingAddress As String = "", Optional ByVal shippingEmail As String = "", Optional ByVal shippingCity As String = "", Optional ByVal shippingPhone As String = "", Optional ByVal shippingFax As String = "", Optional ByVal shippingZip As String = "", Optional ByVal shippingState As Integer = 0) As Boolean
authPar = New SqlParameter(17) {}
authPar(0) = New SqlParameter("@methodName", SqlDbType.NVarChar, 50)
authPar(0).Direction = ParameterDirection.Input
authPar(0).Value = methodName
authPar(1) = New SqlParameter("@customerID", SqlDbType.Int)
authPar(1).Direction = ParameterDirection.Input
authPar(1).Value = customerID
authPar(2) = New SqlParameter("@currentSession", SqlDbType.NVarChar, 50)
authPar(2).Direction = ParameterDirection.Input
authPar(2).Value = currentSession
.
.
.
.
.
authPar(17) = New SqlParameter("@ordID", SqlDbType.Int)
authPar(17).Direction = ParameterDirection.Output
DAL.updateCart(authPar)
If methodName = "receiveOrder" Then
If Not IsDBNull(authPar(17).Value) Then
OrderID = authPar(17).Value
updateCart = True
Else
updateCart = False
End If
Else
If Len(DAL.Msg.ErrorMessage) = 0 Then
updateCart = True
Else
updateCart = False
End If
End If
End Function
End Class
In the above code DAL.updateCart is as follows:
Public Shared Sub updateCart(ByVal ParamArray commandParameters() As SqlParameter)
Dim comm As SqlCommand
comm = New SqlCommand("spUpdateCart", conn)
comm.CommandType = CommandType.StoredProcedure
Dim p As SqlParameter
For Each p In commandParameters
comm.Parameters.Add(p)
Next
Try
Open()
comm.ExecuteNonQuery()
Catch ex As Exception
If Len(Msg.ErrorMessage) = 0 Then
Msg.ErrorMessage = "Important ! " & ex.Message
Else
Msg.ErrorMessage &= "<br />Important ! " & ex.Message
End If
Finally
Close()
End Try
End Sub
For the last couple of days I searched everywhere to resolve this issue with no success yet. I would be much grateful to the person who can help me figure out the error in my code thus resolving the issue.
I created a shopping cart using VB.NET and SQL Sever 2005, made several objects and their respective properties and methods. Everything goes fine on development machine.
The build always fails while publishing without errors in the error list but the Output window shows the following:
receipt.aspx.vb(62,0): error BC30456: 'updateCart' is not a member of 'cart'.
receipt.aspx.vb(63,0): error BC30456: 'OrderID' is not a member of 'cart'.
registration.aspx.vb(42,0): error BC30456: 'updateCart' is not a member of 'cart'.
shipping.aspx.vb(116,0): error BC30456: 'updateCart' is not a member of 'cart'.
signin.aspx.vb(37,0): error BC30456: 'ValidateCustomer' is not a member of 'cart'.
signin.aspx.vb(38,0): error BC30456: 'CustomerIdentity' is not a member of 'cart'.
signin.aspx.vb(39,0): error BC30456: 'FullName' is not a member of 'cart'.
signin.aspx.vb(40,0): error BC30456: 'CustomerStatus' is not a member of 'cart'.
signin.aspx.vb(42,0): error BC30456: 'updateCart' is not a member of 'cart'.
Where 'cart' is my self written object.
FYI I am pasting the code of 'cart' object below:
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class Cart
Private _custSession As String
Private _custId As Integer
Private _prodQty As Integer
Private _prodCost As Double
Private _isEmpty As Boolean
Private _fullName As String
Private _orderID As Integer
Private _orderSubmit As Boolean
Private _custStatus As Integer
Public customer As New Customer
Dim authPar() As SqlParameter
Public Property SessionID() As String
Get
Return _custSession
End Get
Set(ByVal value As String)
_custSession = value
End Set
End Property
Public Property CustomerIdentity() As Integer
Get
Return _custId
End Get
Set(ByVal value As Integer)
_custId = value
End Set
End Property
Public Property ProductQuantity() As Integer
Get
Return _prodQty
End Get
Set(ByVal value As Integer)
_prodQty = value
End Set
End Property
Public Property ProductPrice() As Double
Get
Return _prodCost
End Get
Set(ByVal value As Double)
_prodCost = value
End Set
End Property
Public Property HasItems() As Boolean
Get
Return _isEmpty
End Get
Set(ByVal value As Boolean)
_isEmpty = value
End Set
End Property
Public Property FullName() As String
Get
Return _fullName
End Get
Set(ByVal value As String)
_fullName = value
End Set
End Property
Public Property CustomerStatus() As Integer
Get
Return _custStatus
End Get
Set(ByVal value As Integer)
_custStatus = value
End Set
End Property
Public Property OrderID() As Integer
Get
Return _orderID
End Get
Set(ByVal value As Integer)
_orderID = value
End Set
End Property
Public Function ValidateCustomer(ByVal user As String, ByVal password As String, Optional ByVal id As Integer = 0) As Boolean
authPar = New SqlParameter(4) {}
authPar(0) = New SqlParameter("@loginid", SqlDbType.NVarChar, 50)
authPar(0).Direction = ParameterDirection.Input
authPar(0).Value = user
authPar(1) = New SqlParameter("@password", SqlDbType.NVarChar, 50)
authPar(1).Direction = ParameterDirection.Input
authPar(1).Value = password
.
.
.
.
.
authPar(4) = New SqlParameter("@customerStatus", SqlDbType.Int)
authPar(4).Direction = ParameterDirection.Output
DAL.verify(authPar)
If Not IsDBNull(authPar(2).Value) Then
CustomerIdentity = authPar(2).Value
FullName = authPar(3).Value
CustomerStatus = authPar(4).Value
ValidateCustomer = True
Else
ValidateCustomer = False
End If
End Function
Public Function updateCart(ByVal methodName As String, Optional ByVal prodID As Integer = 0, Optional ByVal prodQty As Integer = 0, Optional ByVal customerID As Integer = 0, Optional ByVal currentSession As String = "", Optional ByVal Prods As String = "", Optional ByVal Qtys As String = "", Optional ByVal prices As String = "", Optional ByVal shippingFName As String = "", Optional ByVal shippingLName As String = "", Optional ByVal shippingAddress As String = "", Optional ByVal shippingEmail As String = "", Optional ByVal shippingCity As String = "", Optional ByVal shippingPhone As String = "", Optional ByVal shippingFax As String = "", Optional ByVal shippingZip As String = "", Optional ByVal shippingState As Integer = 0) As Boolean
authPar = New SqlParameter(17) {}
authPar(0) = New SqlParameter("@methodName", SqlDbType.NVarChar, 50)
authPar(0).Direction = ParameterDirection.Input
authPar(0).Value = methodName
authPar(1) = New SqlParameter("@customerID", SqlDbType.Int)
authPar(1).Direction = ParameterDirection.Input
authPar(1).Value = customerID
authPar(2) = New SqlParameter("@currentSession", SqlDbType.NVarChar, 50)
authPar(2).Direction = ParameterDirection.Input
authPar(2).Value = currentSession
.
.
.
.
.
authPar(17) = New SqlParameter("@ordID", SqlDbType.Int)
authPar(17).Direction = ParameterDirection.Output
DAL.updateCart(authPar)
If methodName = "receiveOrder" Then
If Not IsDBNull(authPar(17).Value) Then
OrderID = authPar(17).Value
updateCart = True
Else
updateCart = False
End If
Else
If Len(DAL.Msg.ErrorMessage) = 0 Then
updateCart = True
Else
updateCart = False
End If
End If
End Function
End Class
In the above code DAL.updateCart is as follows:
Public Shared Sub updateCart(ByVal ParamArray commandParameters() As SqlParameter)
Dim comm As SqlCommand
comm = New SqlCommand("spUpdateCart", conn)
comm.CommandType = CommandType.StoredProcedure
Dim p As SqlParameter
For Each p In commandParameters
comm.Parameters.Add(p)
Next
Try
Open()
comm.ExecuteNonQuery()
Catch ex As Exception
If Len(Msg.ErrorMessage) = 0 Then
Msg.ErrorMessage = "Important ! " & ex.Message
Else
Msg.ErrorMessage &= "<br />Important ! " & ex.Message
End If
Finally
Close()
End Try
End Sub
For the last couple of days I searched everywhere to resolve this issue with no success yet. I would be much grateful to the person who can help me figure out the error in my code thus resolving the issue.