Error using database: "Unknown Target Conversion Type"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David P. Donahue

    Error using database: "Unknown Target Conversion Type"

    I'm using C# to create an ASP .NET website backed by a MySQL database.
    One of the things I do often on the site is populate a DataList by
    binding it to a DataSet pulled from the database. However, I'm running
    into a bit of a problem with a specific field type in the database.

    It seems that fields of type TEXT (a kind of binary way of storing large
    amounts of text) generate the error "Unknown Target Conversion Type"
    when I try to bind them in my DataList's ItemTemplate as such:

    <%# DataBinder.Eval (Container.Data Item, "FieldName" ) %>

    I tried appending a .ToString() on the end of that, as well as enclosing
    it in a Convert.ToStrin g(), but neither had any change. The SELECT
    query itself wraps the field in a CAST(FieldName AS CHAR) but that seems
    to only do so much. It allows the above to work on some queries, but
    not on others (and the queries are nearly identical, just grabbing from
    different tables).

    I've been stumped on this one for a while, can anyone help? Maybe I
    should try a different approach when binding the data? Any ideas? Any
    help would be much appreciated, thank you.


    Regards,
    David P. Donahue
    ddonahue@ccs.ne u.edu
Working...