[Mono-list] Problem with Npgsql

Willngton Roque willngton at gmail.com
Fri Sep 23 09:35:34 EDT 2005


I'm try using Mono with Npgsql and have this problem.
I'm try reboot my pc and de problem percist.

Unhandled Exception: System.InvalidOperationException: DataReader positioned
beyond end of result set.
in <0x00092> Npgsql.NpgsqlDataReader:CheckHaveRow ()
in <0x00058> Npgsql.NpgsqlDataReader:GetValue (Int32 Index)
in <0x00051> Npgsql.NpgsqlDataReader:get_Item (System.String name)
in <0x000aa> MonoSql:Main (System.String[] args)

Help me?

Ubuntu 5.04 + Mono JIT compiler version 1.1.9

Thanks

---code

// created on 23/9/2005 at 08:43
using System;
using System.Data;
using Npgsql;

class MonoSql
{
public static void Main(string[] args)
{
string strConn = "Server=localhost;"+
"Port=5432;"+
"User ID=postgres;"+
"Password=;"+
"Database=teste;";

NpgsqlConnection cnn = new NpgsqlConnection(strConn);

string sql = "Select * from teste order by nome";
NpgsqlCommand cmd = new NpgsqlCommand(sql, cnn);

cnn.Open();

NpgsqlDataReader dr = cmd.ExecuteReader();


while (dr.Read());
{
Console.WriteLine("Nome: " + dr["nome"]);
}

cnn.Close();

Console.WriteLine("Para finalizar precione qq tecla");

Console.ReadLine();

}
}


--


--
Willngton Roque
E-mail: willngton at gmail.com
MSN: willngton at hotmail.com
ICQ: 82484019
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20050923/fca7a501/attachment.html


More information about the Mono-list mailing list