[Mono-list] POSGRESQL / NPGSQL / MONO / DATASET
Francisco Figueiredo Jr.
fxjrlists@yahoo.com.br
Tue, 08 Jun 2004 09:26:11 -0300
KiOrKY wrote:
>wan someone help to run npgsql with mono.
>in fact datareader work fine but not dataapdeter and so dataset!
>
>here is the report:
>debian sid
>kernel 2.4.26
>mcs 095
>mono 20040603
>gecko-sharp-0.4 gtksourceview-sharp-0.3 winelib-0.3
>gtk-sharp-0.93 libgdiplus-0.8 wine20040505
>
>the base is postgresql and is not on the same machine
>
>the result; out of memory error
>
>DB BASE SHEMA:
>base postgresql
>provider: npgsql
>table popo
>column: C1: int C2: string
>
>
>code:
>try {
>cout.WriteLine("\t\t---------------------------------------------");
>cout.WriteLine("\t\t--- DEBUT APPLICATION -----");
>cout.WriteLine("\t\t---------------------------------------------");
>string srequet =@"delete from popo;";
>srequet+=@"insert into popo(sssss,xdsd)";
>srequet+=@"values('59','aaaaa');";
>srequet+=@"insert into popo(sssss,xdsd)";
>srequet+=@"values('519','aaaaa');";
>srequet+=@"insert into popo(sssss,xdsd)";
>srequet+=@"values('529','aaaaa');";
>srequet+=@"insert into popo(sssss,xdsd)";
>srequet+=@"values('359','aaaaa');";
>srequet+=@"insert into popo(sssss,xdsd)";
>srequet+=@"values('459','aaaaa');";
>srequet+=@"SELECT * FROM popo";
>string srequet3=@"Server=126.10.0.1;Port=5432;User Id=Pasquet;Database=";
>srequet3+=@"Marrot;Password=kiorky";
>Npgsql.NpgsqlConnection toto = new Npgsql.NpgsqlConnection(srequet3);
>toto.Open();
>Npgsql.NpgsqlCommand cmd = new Npgsql.NpgsqlCommand(srequet,toto);
>Npgsql.NpgsqlDataAdapter DaAd = new Npgsql.NpgsqlDataAdapter(cmd);
>DataSet Dsdset = new DataSet();
>DaAd.Fill(Dsdset);
>Dsdset.AcceptChanges();
>DataTableCollection dtccol = Dsdset.Tables;
>foreach(DataTable dtta in dtccol)
>{
>cout.WriteLine( dtta.TableName);
>foreach(DataRow drro in dtta.Rows)
>{
>cout.WriteLine("c1: {0} <-> c2: {1} <->
>\n",(Int32)drro.ItemArray[0],drro.ItemArray[1]);
>}
>}
>toto.Close();
>
>
>exectuion report
>doldit100:/home/kiorky/bin/jeveux# mono toto.exe
> ---------------------------------------------
> --- DEBUT APPLICATION -----
> ---------------------------------------------
>execption levee: Out of memory
>doldit100:/home/kiorky/bin/jeveux# mono --debug toto.exe
>
>** (toto.exe:24747): WARNING **: Symbol file
>/usr//lib/mono/gac/Accessibility/1.0.5000.0__b03f5f7f11d50a3a/Accessibility.dll
>has incorrect version (expected 37, got 36)
>
>** (toto.exe:24747): WARNING **: Symbol file
>/usr//lib/mono/gac/System.Windows.Forms/1.0.5000.0__b77a5c561934e089/System.Windows.Forms.dll
>has incorrect version (expected 37, got 36)
>
>** (toto.exe:24747): WARNING **: Symbol file
>/usr//lib/mono/gac/System.Design/1.0.5000.0__b03f5f7f11d50a3a/System.Design.dll
>has incorrect version (expected 37, got 36)
>
>** (toto.exe:24747): WARNING **: Symbol file
>/usr//lib/mono/gac/Npgsql/1.0.5000.0__5d8b90d52f46fda7/Npgsql.dll has
>incorrect version (expected 37, got 36)
> ---------------------------------------------
> --- DEBUT APPLICATION -----
> ---------------------------------------------
>** (toto.exe:24751): WARNING **: Symbol file
>/usr//lib/mono/gac/Mono.Posix/1.0.5000.0__0738eb9f132ed756/Mono.Posix.dll
>has incorrect version (expected 37, got 36)
>
>
>-------------------> execption levee: Out of memory
>
>
>version:
> doldit100:/home/kiorky/bin/jeveux# monodis --assembly
>/usr/lib/mono/gac/Npgsql/1.0.5000.0__5d8b90d52f46fda7/Npgsql.dll
>Assembly Table
>Name: Npgsql
>Hash Algoritm: 0x00008004
>Version: 1.0.5000.0
>Flags: 0x00000000
>PublicKey: BlobPtr (0x000004b8)
> Dump:
>0x00000000: 00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00
>0x00000010: 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00
>0x00000020: 2B 3C 59 0B 2A 4E 3D 34 7E 68 78 DC 0F F4 D2 1E
>0x00000030: B0 56 A5 04 20 25 0C 66 17 04 43 30 70 1D 35 C9
>0x00000040: 80 78 A5 DF 97 A6 2D 83 C9 A2 DB 2D 07 25 23 A8
>0x00000050: FC 49 13 98 25 4C 6B 89 32 9B 8C 1D CE F4 3A 1E
>0x00000060: 7A A1 61 53 BC EA 2A E9 A4 71 14 56 24 82 6F 60
>0x00000070: D7 C8 E7 1C D0 25 B5 54 A0 17 7B D9 35 A7 80 96
>0x00000080: 29 F0 A7 AF C7 78 EB B4 AD 03 3E 1B F5 12 C1 A9
>0x00000090: C6 CE EA 26 B0 77 BC 46 CA C9 38 00 43 5E 77 EE
>Culture:
>
>
>
>
>
>
>
Hi Kiorky.
Sorry for late response...
I was in a conference here in my country and couldn't answer you in time :)
I'm at my job right now and I don't have the complete devel environment
setup here...
I will try your example when I get home to see if I get the same results...
I see that you are passing the delete, inserts and select to dataadapter...
could you try to send the delete and inserts first, with
NpgsqlCommand.ExecuteNonQuery() and later try to use the dataadapter
with select only?
I hope it helps.
Regards,
Francisco Figueiredo Jr.