none
oledbdataadapter gives unsupportedconversion error when reading ntext or image column from SQL CE RRS feed

  • Question

  • I have a VS 2008 C# application which used an Access/Jet database containing an IMAGE column and several NTEXT columns. I changed the app to use SQL CE 3.5, changed the provider in the connection string, but otherwise table schema is identical.

    When reading records, it throws a "general error" with the error message:

    OleDbDataAdapter internal error: invalid row set accessor: Ordinal=3 Status=UNSUPPORTEDCONVERSION 

    The code as follows:

     

    OleDbConnection cnSQL;
    OleDbCommand cmSQL;
    OleDbDataReader drSQL;

     

    string strSQL;
    try
    {

    strSQL =

    "select table_id, column_2 " +
           ",photograph" +
           ",Notes" +
           " from mytable where table_id = '" + searchKey + "'";

    cnSQL =

    new OleDbConnection(Connectionstring);
    cnSQL.Open();
    cmSQL =
    new OleDbCommand(strSQL, cnSQL);
    drSQL = cmSQL.ExecuteReader();

     

    if (drSQL.Read())
    {
          etc.
    }

     

    catch (OleDbException e)
    {
          MessageBox.Show(e.Message, "SQL Error");
    }
    catch (Exception e)
    {
          
    MessageBox.Show(e.Message, "General Error");
    }

    If I comment out the IMAGE and NTEXT columns, all works fine. 

    Does anyone used the OleDbDataReader to read IMAGE columns from SQL Compact Edition 3.5? (or recognize where I may have gone wrong?)
     

    Wednesday, December 30, 2009 3:33 PM

All replies

  • On which line of code does the error occur? I don't see any code that references the column values.

    BTW, you may want to consider using the native SQLCE namespace instead of OLEDB.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, December 30, 2009 4:04 PM
  • Hi Joe,

     

    As Paul said, could you please provide us with more detailed information about this problem?   

     

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

     

    Have a nice day!

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, January 4, 2010 12:59 AM
    Moderator
  • Hi Joe,

     

    I am writing to check the status of the issue on your side.  
     

    If you need further assistance, please feel free to let me know.   I will be more than happy to be of assistance.

     

    Have a nice day!

     

     

    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, January 7, 2010 4:04 AM
    Moderator