[IronPython] IronPython + Npgsql

Martin Maly martmaly at exchange.microsoft.com
Tue Apr 5 00:44:08 CEST 2005


There is known issue with indexing where IronPython may have trouble finding the right indexer.
This may be what you are hitting. I am not familiar with Npgsql, but on .Net classes there is
often property that you can access directly and bypass the access by index.

Martin

> On Monday, April 04, 2005 12:32 PM Hector Miuler Malpica Gallegos Wrote:
> Sent: Monday, April 04, 2005 12:32 PM
> To: users-ironpython.com at lists.ironpython.com
> Subject: [IronPython] IronPython + Npgsql

> Hello friends, I am using Npgsql, from IronPython functions, but I do not be able
> optener data of the results, some idea of as I can do it?  


> Conn = Npgsql.NpgsqlConnection("Server=127.0.0.1;Port=5432;User Id=miuler;Password=miuler;Database=basecsd;")
> Conn.Open()

> Cmd = Npgsql.NpgsqlCommand("select version()", Conn)
> Resultado = Cmd.ExecuteScalar()
> print Resultado 
> Cmd = Npgsql.NpgsqlCommand("select * from clientes;", Conn)
> Resultado = Cmd.ExecuteReader()
> while (Resultado.Read()):
> print Resultado
> #~ print Resultado[1] # <-- error
> Conn.Close()




More information about the Ironpython-users mailing list