.NETGURU
Error Message
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngfreeforall' list.


Paul Dot Net Guruhews
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 Dot Net Guruhews [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 Dot Net Guruhews
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 Dot Net Guruhews [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 Dot Net Guruhews [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 Dot Net Guruhews
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 Dot Net Guruhews [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 Dot Net Guruhews [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 Dot Net Guruhews [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 Dot Net Guruhews
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 Dot Net Guruhews [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 Dot Net Guruhews [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 Dot Net Guruhews [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 Dot Net Guruhews [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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification