[IronPython] Array of Objects in IronPython

Dody Gunawinata empirebuilder at gmail.com
Tue Mar 3 17:07:49 CET 2009


values = System.Array.CreateInstance(System.Object, reader.FieldCount)


On Tue, Mar 3, 2009 at 6:03 PM, Bernd Viehmann
<bernd.viehmann at ascom-ac.de> wrote:
> Hi,
>
> I have a question regarding a typed array.
>
> Basically I want to use IronPython and ADO.NET to get some data from a
> stored procedure. My first idea was to use a SQL DataReader to get all the
> lines of my result table into an array. Csharp way looks like this:
>
> *ArrayList rowList = new ArrayList();*
> SqlDataReader reader = storedProcCommand.ExecuteReader();
> while (reader.Read())
> {
>  *object[] values = new object[reader.FieldCount];*
>  *reader.GetValues(values);*
>  *rowList.Add(values);*
> }
>
> My problem is to generate an array of type object to feed
> *reader.GetValues(values) with it. Any ideas how this can be done?
>
> Kind regards from Germany
>
> Bernd
>
> *
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>



-- 
nomadlife.org



More information about the Ironpython-users mailing list