Error Message
Messages   Related Types
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

Reply to this message...
 
    
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.

Reply to this message...
 
    
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

Reply to this message...
 
    
Yossi Dahan
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

Reply to this message...
 
    
Paul Matthews
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

Reply to this message...
 
    
Yossi Dahan
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

Reply to this message...
 
    
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

Reply to this message...
 
    
Feduke Cntr Charles R
You are trying to use a function that operates on members of the
IConvertible interface, but an object you are trying to pass to that
function does not implement the IConvertible interface and therefore does
not have any of the required members, thus the error.

- Chuck

-----Original Message-----
From: Yossi Dahan [mailto:Click here to reveal e-mail address]
Sent: Wednesday, August 14, 2002 11:40 AM
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

Reply to this message...
 
 
System.Data.CommandType
System.Data.SqlClient.SqlCommand
System.Data.SqlClient.SqlConnection
System.Data.SqlClient.SqlParameter
System.Data.SqlDbType
System.IConvertible
System.Web.UI.MobileControls.TextBox
System.Web.UI.WebControls.TextBox
System.Windows.Forms.TextBox




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com