Error:Object must implement IConvertible

Discussion in 'ASP .Net' started by Bob Frasca, Jul 29, 2003.

  1. Bob Frasca

    Bob Frasca Guest

    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, Jul 29, 2003
    #1
    1. Advertising

  2. Bob Frasca

    Bob Frasca Guest

    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" <> wrote in message
    news:%...
    > 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, Jul 29, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leon Shaw
    Replies:
    5
    Views:
    893
    Leon Shaw
    Jul 29, 2003
  2. =?Utf-8?B?VGltOjouLg==?=

    Error: Object must implement IConvertible

    =?Utf-8?B?VGltOjouLg==?=, Dec 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,143
    Guest
    Dec 14, 2004
  3. =?Utf-8?B?VGltOjouLg==?=

    Object must implement IConvertible.

    =?Utf-8?B?VGltOjouLg==?=, Dec 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,948
    Kevin Spencer
    Dec 15, 2004
  4. Replies:
    4
    Views:
    3,327
  5. Replies:
    2
    Views:
    1,321
Loading...

Share This Page