[Mono-list] POSGRESQL / NPGSQL / MONO / DATASET

KiOrKY KiOrKY <kiorky@goddess-gate.com>
Wed, 9 Jun 2004 08:21:44 +0200


ok so thats the result whithou try catch::
where do you live, we seems not to have at all the same hour !!! :)
Unhandled Exception: System.OutOfMemoryException: Out of memory
#0: 0x0000c callvirt   in System.Data.Common.DbDataAdapter:BuildSchema (System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType) (0x8230230 [0x828b3f0] [0x8342da8] [2] )
#1: 0x0001e callvirt   in System.Data.Common.DbDataAdapter:FillTable (System.Data.DataTable,System.Data.IDataReader,int,int,int&) (0x8230230 [0x8342da8] [0x828b3f0] [0] [0] [1098862164] )
#2: 0x00062 callvirt   in System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,string,System.Data.IDataReader,int,int) (0x8230230 [0x809a740] [0x827a690] [0x828b3f0] [0] [0] )
#3: 0x00040 callvirt   in System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,int,int,string,System.Data.IDbCommand,System.Data.CommandBehavior) (0x8230230 [0x809a740] [0] [0] [0x827a690] [0x809ac00] [0] )
#4: 0x0000d callvirt   in System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet) (0x8230230 [0x809a740] )
#5: 0x00082 callvirt   in ado.generique.requete.select.adapterposgresql2.Appli:Main (string[]) ([0x808d940] )

the code:
/*
 * mpasquet le 21/04/2004 a 14h30
 * 
 *  premier programme d'acces aux donnees
 * 
 **/

namespace ado
{
	namespace generique
	{
			namespace requete
			{
				namespace select
				{
					namespace adapterposgresql2
					{	
						/**     INCLUDES NECCESSAIRES  **/
						using System;
						using ado.generique; // acces generique
						using System.Data;					
					
						/**              ALIAS        **/
						using cout=System.Console;
						/** DEBUT CODE **/
						class Appli	
						{
							public static void Main(string[] args)
							{
								cout.WriteLine("-----------------------------------------\n");
								cout.WriteLine(" Salut   ----> DEBUT  requete_select_adapter)\n");
								cout.WriteLine("         attente touche ...\n");
								cout.WriteLine("-----------------------------------------\n");									
								/****/
								try
								{		
									// Enable logging.
									Npgsql.NpgsqlEventLog.Level = Npgsql.LogLevel.Debug;
									Npgsql.NpgsqlEventLog.LogName = "NpgsqlTests.LogFile";
									//modOutils mnoutil = new modOutils();//System.IO.File.Copy(mnoutil.renvoipathfichiercfg(),@"ADO.exe.config",true);
									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 scnxtring=@"Server=126.10.0.1;Port=5432;User Id=Pasquet;Database=";
									scnxtring+=@"Marrot;Password=kiorky";
									Npgsql.NpgsqlConnection toto = new Npgsql.NpgsqlConnection(scnxtring);
									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();	
								}
								catch(System.Exception e)
								{
									cout.WriteLine("Exception  levée: "+ e.Message);
								}
								/****/
								cout.WriteLine("-----------------------------------------\n");
								cout.WriteLine(" Bye   ----> FIN  requete_select_adapter\n");
								cout.WriteLine("         attente touche ...\n");
								cout.WriteLine("-----------------------------------------\n");		
								cout.ReadLine();
							}
						}// fin classe APPLI
					}
				}
		
		}
	}
}


Francisco Figueiredo Jr. <fxjrlists@yahoo.com.br> a écrit :

> KiOrKY wrote:
> 
> &gt;ok, im a noob, i have found alon,e looollll
> &gt;just forgot a Npgsql. :D
> &gt;  
> &gt;
> 
> :)
> 
> Hi Kiorky.
> 
> I'm still at my job with no luck getting my dev env working as I'm a 
> little bit busy here today :(
> That's also why I'm only answering now...
> 
> When I get home tonight I will have a better look at this. From your 
> log, data seems to be correctly fetched from server as you get 5 DataRow 
> messages.
> 
> Problem may be in Fill method itself or NpgsqlDataReader may be throwing 
> some exception to Fill method.
> 
> If you try your code without the &quot;try&quot; statement do you get some 
> exception thrown?
> 
> What about gdb mono &quot;your application.exe&quot; ??
> 
> Thanks in  advance.
> 
> Regards,
> 
> Francisco Figueiredo Jr.
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list

-- 
----------------------------
    I{ i () r |{ Y
    Debian User
---------------------------------------------
-- Mathieu PASQUET     
-- Testeur Debian SID
-- irc: #debian-fr / irc.freenode.net port: 6667 
-- Site: www.fr.debian.org 
---------------------------------------------