Hello,
I'm trying to load an empty PgSqlArray, created with the PgSqlArray.CreateEmptyArray method.
It's working in Text mode.
in Binary mode, when executing loader.NextRow() i get a NullReferenceException. Can you verify it?
Thanks!
Regards,
Tiago
Can't load empty array in binary mode
I have checked dotConnect for PostgreSQL v 5.10.126 and PostgreSQL server v 9.0 with the following code:
It works. Please tell us your versions of dotConnect for PostgreSQL (x.xx.xxx), PostgreSQL server, and the way we should modify this sample to reproduce the problem.
Code: Select all
//CREATE TABLE array_test (
// arr integer[] NOT NULL
//);
using (PgSqlConnection conn = new PgSqlConnection()) {
conn.ConnectionString = "server=***;port=***;database=***;uid=***;pwd=***;Protocol=3;";
conn.Open();
PgSqlArray array = PgSqlArray.CreateEmptyArray(PgSqlType.Int);
using (PgSqlLoader loader = new PgSqlLoader()) {
loader.Connection = conn;
loader.TableName = "array_test";
loader.Open();
loader["arr"] = array;
loader.NextRow();
loader.Close();
}
}
Hello,
I'm using v4.95.152 with PostgreSQL 8.4
I changed the sample to change the mode (the default is text mode from what i can see here):
Thanks!
Regards,
Tiago
I'm using v4.95.152 with PostgreSQL 8.4
I changed the sample to change the mode (the default is text mode from what i can see here):
Code: Select all
//CREATE TABLE array_test (
// arr integer[] NOT NULL
//);
using (PgSqlConnection conn = new PgSqlConnection()) {
conn.ConnectionString = "server=***;port=***;database=***;uid=***;pwd=***;Protocol=3;";
conn.Open();
PgSqlArray array = PgSqlArray.CreateEmptyArray(PgSqlType.Int);
using (PgSqlLoader loader = new PgSqlLoader()) {
loader.Connection = conn;
loader.TableName = "array_test";
loader.Mode = PgSqlLoaderMode.Binary; //added
loader.Open();
loader["arr"] = array;
loader.NextRow();
loader.Close();
}
}
Regards,
Tiago
New build of dotConnect for PostgreSQL 5.10.135 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=20709 .
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only): http://secure.devart.com/ .
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=20709 .