Connecting Tech Pros Worldwide Forums | Help | Site Map

Error:Object must implement IConvertible

Bob Frasca
Guest
 
Posts: n/a
#1: Nov 17 '05
I'm trying to execute a datareader that calls a SQL Server stored procedure
and I get this error. I also tried loading a dataset using the database
adapter Fill method and I get the same error.

I have other ASPNET applications that do these things without a problem.

Anyone have any suggestions?



Bob Frasca
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Error:Object must implement IConvertible


For the thread...if anyone's interested.

I resolved this problem. I was passing a parameter to my stored procedure.
I was incorrectly assigning the value to a "varchar" parameter.

Incorrect:

SqlCommandObject.Parameters("@Param").Value = txtTextBox

Correct:

SqlCommandObject.Parameters("@Param").Value = txtTextBox.Text

When it attempted to execute the datareader or the Fill method, SQL Server
(or was it ADONET) was attempting to convert a text box object to a varchar
instead of a text string object to a varchar.

An example of ambiguous naming conventions biting me in the ...


"Bob Frasca" <bfrasca@netspoke.com> wrote in message
news:%23NWzojdVDHA.2052@TK2MSFTNGP10.phx.gbl...[color=blue]
> I'm trying to execute a datareader that calls a SQL Server stored[/color]
procedure[color=blue]
> and I get this error. I also tried loading a dataset using the database
> adapter Fill method and I get the same error.
>
> I have other ASPNET applications that do these things without a problem.
>
> Anyone have any suggestions?
>
>[/color]


Closed Thread