none
Catch Exception when using ADO Object in Silverlight 4.0 Out of Browser RRS feed

  • Question

  • I used ADODB.RecordSet.GetRows() in Silverlight 4.0 OOB (C#) application. Can someone look at part of my code below and tell me what I'm doing wrong?

    //Already create an ADODB.Connection object named adoConnection and Open it.

    internal dynamic adoRecordSet;

    object[] columns = new object[] { "value1","value2"}; // if change columns' type to String (eg:"value1"),no exception.

    adoRecordSet = AutomationFactory.CreateObject("ADODB.recordset");

    adoRecordSet.Open(CommandText, adoConnection);

    object oMissing = System.Reflection.Missing.Value;

    adoRecordSet.GetRows(rows, oMissing, columns); //catch ArgumentException : value does not fall within the expected range.

    Thursday, October 14, 2010 1:56 AM