Page 1 of 1

Error: "insufficient data left in message"

Posted: Mon 09 Jun 2008 14:33
by marlin
I use trial PostgreSQL CF .NET, I get following error "insufficient data left in message" in some specific situation

1) Table for example "pz" have trigger running on DELETE
2) In trigger function we use RAISE EXCEPTION when DELETE is not possible
3) In .NET on mobile device we have

try{
PgSqlCommand sql3 = new PgSqlCommand("DELETE FROM pz WHERE id = :id", pgsqlconnection);

sql3.Parameters.Add("id", id_pz);
sql3.ExecuteNonQuery();
}
catch (Exception e)
{
lasterror = e.Message;
}


In lasterror we get probapbly value from RAISE EXCEPTION from trigger, but when we would like to run another SQL like

PgSqlCommand sql1 = new PgSqlCommand("SELECT * FROM pz WHERE id=:id", pgsqlconnection);

sql1.Parameters.Add("id", id_pz);

PgSqlDataTable dt = new PgSqlDataTable(sql1, pgsqlconnection);

dt.FetchAll = true;
dt.Open();

On dt.Open() we get "insufficient data left in message".

Posted: Mon 09 Jun 2008 14:47
by Alexey.mdr
Hello,

Could you specify the version of CF you are using?
Is there any connection between “delete” and “select” blocks (is the error reproducible on other tables)?
Could you please provide a call stack?

Regards,
Alexey.

Posted: Mon 09 Jun 2008 15:10
by marlin
Version:

PostgreSQLDirect .Net Mobile Trial Edition (3.70.26.1)


stack:

at CoreLab.PostgreSql.l.s() at CoreLab.PostgreSql.l.a0() at CoreLab.PostgreSql.l.a5() at CoreLab.PostgreSql.PgSqlDataReader.al() at CoreLab.PostgreSql.PgSqlCommand.k() at CoreLab.Common.DbCommandBase.e() at System.Data.Common.DbCommand.ExecuteReader() at CoreLab.Common.DbDataTable.a2() at CoreLab.Common.DbDataTable.Open() at SWP.Magazyn_Oklein.DB.GetPzItem() at SWP.Magazyn_Oklein.PZItem.ReloadGrid() at SWP.Magazyn_Oklein.PZItem.button2_Click() at System.Windows.Forms.Control.OnClick() at System.Windows.Forms.Button.OnClick() at System.Windows.Forms.ButtonBase.WnProc() at System.Windows.Forms.Control._InternalWnProc() at Microsoft.AGL.Forms.EVL.EnterModalDialog() at System.Windows.Forms.Form.ShowDialog() at SWP.Magazyn_Oklein.PZ.button2_Click() at System.Windows.Forms.Control.OnClick() at System.Windows.Forms.Button.OnClick() at System.Windows.Forms.ButtonBase.WnProc() at System.Windows.Forms.Control._InternalWnProc() at Microsoft.AGL.Forms.EVL.EnterModalDialog() at System.Windows.Forms.Form.ShowDialog() at SWP.Magazyn_Oklein.Main.menuItem9_Click() at System.Windows.Forms.MenuItem.OnClick() at System.Windows.Forms.Menu.ProcessMnuProc() at System.Windows.Forms.Form.WnProc() at System.Windows.Forms.Control._InternalWnProc() at Microsoft.AGL.Forms.EVL.EnterMainLoop() at System.Windows.Forms.Application.Run() at SWP.Magazyn_Oklein.Program.Main()

Posted: Tue 10 Jun 2008 10:12
by Alexey.mdr
Hello,

What CF do you use?
Please send me (alexeyman*crlab*com) a small test project to
reproduce the problem.
It is desirable to use 'test' schema objects, otherwise
include the
definition of your own database objects.
If it is impossible for you to create the test project, send
us a piece of
your code where the error occurs or describe steps to
reproduce the problem.

Regards,
Alexey.