This message was discovered on ASPFriends.com 'aspngfreeforall' list.
| Paul Matthews |
Does anyone know what the follwing error message means
"Object must implement IConvertible"
many thanks Paul
|
|
| |
| |
| Josh Howe |
I think you need to post some code
-----Original Message----- From: Paul Matthews [mailto:Click here to reveal e-mail address] Sent: Wednesday, August 14, 2002 9:53 AM To: aspngfreeforall Subject: [aspngfreeforall] Error Message
Does anyone know what the follwing error message means
"Object must implement IConvertible"
many thanks Paul
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
DISCLAIMER: The information contained herein is confidential and is intended solely for the addressee(s). It shall not be construed as a recommendation to buy or sell any security. Any unauthorized access, use, reproduction, disclosure or dissemination is prohibited. Neither ISLAND nor any of its subsidiaries or affiliates shall assume any legal liability or responsibility for any incorrect, misleading or altered information contained herein. Thank you.
|
|
| |
|
| |
| Paul Matthews |
sorry here is my function
Function UpdateShoppingCart(ByVal cartid As String, ByVal productid As Integer, ByVal Quantity As Integer) ' Create Instance of Connection and Command Object Dim conn As SqlConnection = New SqlConnection("server=localhost;uid=sa;pwd=;database=golf")
Dim myCommand As SqlCommand = New SqlCommand("UpdateCart", conn)
' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure
' Add Parameters to SPROC Dim parameterCartID As SqlParameter = New SqlParameter("@CartID", SqlDbType.NVarChar, 50) parameterCartID.Value = cartid myCommand.Parameters.Add(parameterCartID)
Dim parameterProductID As SqlParameter = New SqlParameter("@ProductID", SqlDbType.Int, 4) parameterProductID.Value = productid myCommand.Parameters.Add(parameterProductID)
Dim parameterQuantity As SqlParameter = New SqlParameter("@Quantity", SqlDbType.Int, 4) parameterQuantity.Value = parameterQuantity myCommand.Parameters.Add(parameterQuantity)
' Open the connection and execute the Command conn.Open() myCommand.ExecuteNonQuery() conn.Close() End Function
and here is the code that calls the function
Dim ProductID = DGridBasket.DataKeys(e.Item.ItemIndex)
Dim Qty As String = CType(e.Item.FindControl("Quantity"), TextBox).Text
Dim mycartDetails As golfstore.ShoppingCartDB = New golfstore.ShoppingCartDB() 'get the current cartid Dim cartID As String = mycartDetails.GetShoppingCartId()
mycartDetails.UpdateShoppingCart(cartID, ProductID, Qty)
Many Thanks Paul
-----Original Message----- From: Josh Howe [mailto:Click here to reveal e-mail address] Sent: 14 August 2002 14:59 To: aspngfreeforall Subject: [aspngfreeforall] RE: Error Message
I think you need to post some code
-----Original Message----- From: Paul Matthews [mailto:Click here to reveal e-mail address] Sent: Wednesday, August 14, 2002 9:53 AM To: aspngfreeforall Subject: [aspngfreeforall] Error Message
Does anyone know what the follwing error message means
"Object must implement IConvertible"
many thanks Paul
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
DISCLAIMER: The information contained herein is confidential and is intended solely for the addressee(s). It shall not be construed as a recommendation to buy or sell any security. Any unauthorized access, use, reproduction, disclosure or dissemination is prohibited. Neither ISLAND nor any of its subsidiaries or affiliates shall assume any legal liability or responsibility for any incorrect, misleading or altered information contained herein. Thank you.
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
|
|
| |
|
| | |
| | |
| | |
| |
| Paul Matthews |
Below is the function. The error occurs on the following line
myCommand.ExecuteNonQuery()
Function UpdateShoppingCart(ByVal cartid As String, ByVal productid As Integer, ByVal Quantity As Integer) ' Create Instance of Connection and Command Object Dim conn As SqlConnection = New SqlConnection("server=localhost;uid=sa;pwd=;database=golf")
Dim myCommand As SqlCommand = New SqlCommand("UpdateCart", conn)
' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure
' Add Parameters to SPROC Dim parameterCartID As SqlParameter = New SqlParameter("@CartID", SqlDbType.NVarChar, 50) parameterCartID.Value = cartid myCommand.Parameters.Add(parameterCartID)
Dim parameterProductID As SqlParameter = New SqlParameter("@ProductID", SqlDbType.Int, 4) parameterProductID.Value = productid myCommand.Parameters.Add(parameterProductID)
Dim parameterQuantity As SqlParameter = New SqlParameter("@Quantity", SqlDbType.Int, 4) parameterQuantity.Value = parameterQuantity myCommand.Parameters.Add(parameterQuantity)
' Open the connection and execute the Command conn.Open() myCommand.ExecuteNonQuery() conn.Close() End Function
======================================================== here is the code that calls the function
Dim ProductID = DGridBasket.DataKeys(e.Item.ItemIndex)
Dim Qty As String = CType(e.Item.FindControl("Quantity"), TextBox).Text
Dim mycartDetails As golfstore.ShoppingCartDB = New golfstore.ShoppingCartDB() 'get the current cartid Dim cartID As String = mycartDetails.GetShoppingCartId()
mycartDetails.UpdateShoppingCart(cartID, ProductID, Qty)
Many Thanks Paul
-----Original Message----- From: Yossi Dahan [mailto:Click here to reveal e-mail address] Sent: 14 August 2002 16:40 To: aspngfreeforall Subject: [aspngfreeforall] RE: Error Message
Could you post the line in which you declare the class with the given function and also state which line is indicated as the one causing the problem?
-----Original Message----- From: Paul Matthews [mailto:Click here to reveal e-mail address] Sent: Wednesday, August 14, 2002 4:31 PM To: aspngfreeforall Subject: [aspngfreeforall] RE: Error Message
could you please explain. This is a simple update function
cheers Paul
-----Original Message----- From: Yossi Dahan [mailto:Click here to reveal e-mail address] Sent: 14 August 2002 16:21 To: aspngfreeforall Subject: [aspngfreeforall] RE: Error Message
I think it means you have stated that a class implements an interface but did not implement the required function
-----Original Message----- From: Paul Matthews [mailto:Click here to reveal e-mail address] Sent: Wednesday, August 14, 2002 3:53 PM To: aspngfreeforall Subject: [aspngfreeforall] Error Message
Does anyone know what the follwing error message means
"Object must implement IConvertible"
many thanks Paul
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT | news://ls.asplists.com = NEWSGROUP
|
|
| |
|
| | |
|
|
|
|