Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-22 Thread Konstantin Triger

Hello Francisco,

Does the Npqsql initialize each property? i.e. if some column is not a 
key, will the corresponding code succeed?

bool b = (bool)schemaTable[IsKey];

No, currently I don't use any additional metadata, thanks :).

Regards,
Konstantin Triger



Francisco Figueiredo Jr. wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin Triger wrote:
 


Hello Hubert,

There was a change during this week end: the Mainsoft changes were
merged into the trunk (they were previously available at
Mainsoft.System.Data branch).

From the stack I suppose that PG provider does not fully initialize the
SchemaTable and some columns contain nulls.

   



Hi Konstantin!

Npgsql is returning the following metadata schema:


result.Columns.Add (ColumnName, typeof (string));
   result.Columns.Add (ColumnOrdinal, typeof (int));
   result.Columns.Add (ColumnSize, typeof (int));
   result.Columns.Add (NumericPrecision, typeof (int));
   result.Columns.Add (NumericScale, typeof (int));
   result.Columns.Add (IsUnique, typeof (bool));
   result.Columns.Add (IsKey, typeof (bool));
   result.Columns.Add (BaseCatalogName, typeof (string));
   result.Columns.Add (BaseColumnName, typeof (string));
   result.Columns.Add (BaseSchemaName, typeof (string));
   result.Columns.Add (BaseTableName, typeof (string));
   result.Columns.Add (DataType, typeof(Type));
   result.Columns.Add (AllowDBNull, typeof (bool));
   result.Columns.Add (ProviderType, typeof (int));
   result.Columns.Add (IsAliased, typeof (bool));
   result.Columns.Add (IsExpression, typeof (bool));
   result.Columns.Add (IsIdentity, typeof (bool));
   result.Columns.Add (IsAutoIncrement, typeof (bool));
   result.Columns.Add (IsRowVersion, typeof (bool));
   result.Columns.Add (IsHidden, typeof (bool));
   result.Columns.Add (IsLong, typeof (bool));
   result.Columns.Add (IsReadOnly, typeof (bool));


Please, let me know if you are using any other metadata info so I can
add it accordingly.

Thanks in advance.




- --
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://gborg.postgresql.org/project/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -
Science without religion is lame;
religion without science is blind.

 ~ Albert Einstein
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQo30PP7iFmsNzeXfAQJaTwf9H85e6MGVDWo6uyE6jnewkaL5ivq7JS4z
6/Vvwwk3xmMkj5WhKcF2wQa9Zo4RWZYpTcmT5uoyYJl68Yl5puSnNinWeSa7h5rg
QTD9FXrhQ+IGvylGqS+U1reKC6JGJZC/A2fwJZPKYqjKh7MXutNy3cwERVzLqpYr
kSxHLdQt7kIPC5arpzcQMjOMAhg96X/03XxqnrupO7ACAdqyoC/uCfRGWte3+DDZ
UHg8Uka+OK0EsNPwVGUH7PpUWZp5Cn1qbiJ/eFJphaXTxZMLKKOTawvYVFI5lOxP
qCDe4RsFjosp4kYOkS+m9UtKbtr0vp2euY8+Y7l6TjyRADHNijemQg==
=BBjE
-END PGP SIGNATURE-

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
 


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-20 Thread Hubert FONGARNAND


Hello,
I've retested my apps with the new svn version... I can now log into my 
app
without this System.IndexOutOfRangeException: Array index is out of range.

But there's problem with some sql commands... with postgresql, oracle and
mssql

I think that it's when I combine several select in 1 sqlcmd...
i will check this today...
thanks

Le Mercredi 18 Mai 2005 11:32, vous avez écrit :
 Hello Hubert,

 I'm completely agree that bugs are a bad thing, that's why I'm here to
 help you as soon as possible. The reason the DataAdapter code has
 changed is to solve other bugs, and the solution required some
 cooperation from providers too. Unfortunately it's not simple to make
 a complete testing over all the providers, so I do expect for some
 number of issues, but believe that with yours and others help we will
 stabilize the code very fast.

 I would like to ask you several questions:

1. Does your PG app work? If not, can you send the stack traces/code
   samples of the problems?
2. What is your current problem with Oracle? Can you please send a
   stack? (It cannot be the same one because in my latest patch I
   removed the calls to System.Data.DataRow:get_Item (System.String
   columnName) from the BuildSchema).
3. If it's possible, can you send your entire app, so I'll test it
   here? (The confidentiality will be ensured).

 Thank you in advance for your patience and cooperation.

 Regards,
 Konstantin Triger

 Hubert FONGARNAND wrote:
 You're patch has nothing changes... I get always the same error...
 With the postgresql app... I can now login... but there's plenty of bugs
 inside... I think the best solution is to get an older version of Mono!
 
 Why do you include a patch if there's compatibility problems with data
 providers!!!
 
 thanks
 
 Le Mardi 17 Mai 2005 16:26, vous avez écrit :
 Hello again,
 
 Seems that Oracle provider does not initialize at all some columns in
 SchemaTable.
 The attached patch fixes that in a generic way.
 
 Regards,
 Konstantin Triger
 
 Hubert FONGARNAND wrote:
 I've applied your patch...
 It corrects the problem with my postgresql app...
 but i get always an error with the same app with oracle :
 
 System.IndexOutOfRangeException: Array index is out of range.
 in 0x00067 System.Data.DataRow:get_Item (System.String columnName,
 DataRowVersion version)
 in 0x00015 System.Data.DataRow:get_Item (System.String columnName)
 in 0x00495 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
 reader, System.Data.DataTable table, SchemaType schemaType,
 MissingSchemaAction missingSchAction, MissingMappingAction
 missingMapAction,
 System.Data.Common.DataTableMappingCollection dtMapping)
 in 0x00059 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
 reader, System.Data.DataTable table, SchemaType schemaType)
 in (wrapper remoting-invoke-with-check)
 System.Data.Common.DbDataAdapter:BuildSchema
 (System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType)
 in 0x00087 System.Data.Common.DbDataAdapter:FillTable
 (System.Data.DataTable dataTable, IDataReader dataReader, Int32
 startRecord, Int32 maxRecords, System.Int32 counter)
 in (wrapper remoting-invoke-with-check)
 System.Data.Common.DbDataAdapter:FillTable
 (System.Data.DataTable,System.Data.IDataReader,int,int,int)
 in 0x00117 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, System.String srcTable, IDataReader dataReader, Int32
 startRecord, Int32 maxRecords)
 in 0x000ce System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, Int32 startRecord, Int32 maxRecords, System.String srcTable,
 IDbCommand command, CommandBehavior behavior)
 in 0x00036 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, System.String srcTable)
 in (wrapper remoting-invoke-with-check)
 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,string)
 in 0x00121 MoteurCRM.CProfil:RetourneGroupeCommercial (System.String
 cnxstring, System.String televendeur_Id)
 in 0x007e7 FicheClient.Logon:btnValider_Click (System.Object sender,
 System.EventArgs e)
 in (wrapper delegate-invoke)
 System.MulticastDelegate:invoke_void_object_EventArgs
 (object,System.EventArgs)
 
 Thanks...
 
 Le Mardi 17 Mai 2005 12:09, Konstantin Triger a écrit :
 Agreed, but in fact the provider should set the defaults, not the
 DataAdapter :-).
 
 Regards,
 Konstantin Triger
 
 Sureshkumar T wrote:
 +   bool 
 allowDBNull = value is bool ? (bool)value : false;
 
 default allowDBNull should be true ;-)
 
 suresh.
 
 ___
 Ce message et les éventuels documents joints peuvent contenir des
 informations confidentielles. Au cas où il ne vous serait pas destiné,
 nous vous remercions de bien vouloir le supprimer et en aviser
 immédiatement l'expéditeur. Toute utilisation de ce message non conforme
 à sa destination, toute diffusion ou publication, totale ou partielle et
 quel qu'en soit 

Re: [Mono-devel-list] Problem with DbDataAdapter... RESOLVED

2005-05-20 Thread Hubert FONGARNAND
Hello

I've found the last problems I had...
The problem is when you do a fill with a null datetime in the result 
dataset...
the problem is in method
internal void ReadIDataRecord(int recordIndex, IDataRecord record, int[] 
mapping, int length)
of the record cache class
this method do a call of :
column.DataContainer.SetItemFromDataRecord(recordIndex, record,i);

so the problem comes from the sealed class DateTimeDataContainer : 
AbstractObjectDataContainer

the method record.GetDateTime(field); throw a not well catched exception when 
the datetime is null
So, as a trick, i've added a try catch :

my patch is :

Index: DataContainer.cs
===
--- DataContainer.cs(revision 44793)
+++ DataContainer.cs(working copy)
@@ -1069,7 +1069,15 @@
{
// if exception thrown, it should be caught
// in the  caller method
-   
base.SetValue(index,record.GetDateTime(field));
+   Object date=null;
+   try
+   {
+date=record.GetDateTime(field);
+   }catch
+   {
+   }
+   base.SetValue(index,date);
+

base.SetItemFromDataRecord(index,record,field);
}



Le Mercredi 18 Mai 2005 11:32, vous avez écrit :
 Hello Hubert,

 I'm completely agree that bugs are a bad thing, that's why I'm here to
 help you as soon as possible. The reason the DataAdapter code has
 changed is to solve other bugs, and the solution required some
 cooperation from providers too. Unfortunately it's not simple to make
 a complete testing over all the providers, so I do expect for some
 number of issues, but believe that with yours and others help we will
 stabilize the code very fast.

 I would like to ask you several questions:

1. Does your PG app work? If not, can you send the stack traces/code
   samples of the problems?
2. What is your current problem with Oracle? Can you please send a
   stack? (It cannot be the same one because in my latest patch I
   removed the calls to System.Data.DataRow:get_Item (System.String
   columnName) from the BuildSchema).
3. If it's possible, can you send your entire app, so I'll test it
   here? (The confidentiality will be ensured).

 Thank you in advance for your patience and cooperation.

 Regards,
 Konstantin Triger

 Hubert FONGARNAND wrote:
 You're patch has nothing changes... I get always the same error...
 With the postgresql app... I can now login... but there's plenty of bugs
 inside... I think the best solution is to get an older version of Mono!
 
 Why do you include a patch if there's compatibility problems with data
 providers!!!
 
 thanks
 
 Le Mardi 17 Mai 2005 16:26, vous avez écrit :
 Hello again,
 
 Seems that Oracle provider does not initialize at all some columns in
 SchemaTable.
 The attached patch fixes that in a generic way.
 
 Regards,
 Konstantin Triger
 
 Hubert FONGARNAND wrote:
 I've applied your patch...
 It corrects the problem with my postgresql app...
 but i get always an error with the same app with oracle :
 
 System.IndexOutOfRangeException: Array index is out of range.
 in 0x00067 System.Data.DataRow:get_Item (System.String columnName,
 DataRowVersion version)
 in 0x00015 System.Data.DataRow:get_Item (System.String columnName)
 in 0x00495 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
 reader, System.Data.DataTable table, SchemaType schemaType,
 MissingSchemaAction missingSchAction, MissingMappingAction
 missingMapAction,
 System.Data.Common.DataTableMappingCollection dtMapping)
 in 0x00059 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
 reader, System.Data.DataTable table, SchemaType schemaType)
 in (wrapper remoting-invoke-with-check)
 System.Data.Common.DbDataAdapter:BuildSchema
 (System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType)
 in 0x00087 System.Data.Common.DbDataAdapter:FillTable
 (System.Data.DataTable dataTable, IDataReader dataReader, Int32
 startRecord, Int32 maxRecords, System.Int32 counter)
 in (wrapper remoting-invoke-with-check)
 System.Data.Common.DbDataAdapter:FillTable
 (System.Data.DataTable,System.Data.IDataReader,int,int,int)
 in 0x00117 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, System.String srcTable, IDataReader dataReader, Int32
 startRecord, Int32 maxRecords)
 in 0x000ce System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, Int32 startRecord, Int32 maxRecords, System.String srcTable,
 IDbCommand command, CommandBehavior behavior)
 in 0x00036 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, System.String srcTable)
 in (wrapper 

Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-20 Thread Francisco Figueiredo Jr.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin Triger wrote:
 Hello Hubert,
 
 There was a change during this week end: the Mainsoft changes were
 merged into the trunk (they were previously available at
 Mainsoft.System.Data branch).
 
 From the stack I suppose that PG provider does not fully initialize the
 SchemaTable and some columns contain nulls.
 

Hi Konstantin!

Npgsql is returning the following metadata schema:


result.Columns.Add (ColumnName, typeof (string));
result.Columns.Add (ColumnOrdinal, typeof (int));
result.Columns.Add (ColumnSize, typeof (int));
result.Columns.Add (NumericPrecision, typeof (int));
result.Columns.Add (NumericScale, typeof (int));
result.Columns.Add (IsUnique, typeof (bool));
result.Columns.Add (IsKey, typeof (bool));
result.Columns.Add (BaseCatalogName, typeof (string));
result.Columns.Add (BaseColumnName, typeof (string));
result.Columns.Add (BaseSchemaName, typeof (string));
result.Columns.Add (BaseTableName, typeof (string));
result.Columns.Add (DataType, typeof(Type));
result.Columns.Add (AllowDBNull, typeof (bool));
result.Columns.Add (ProviderType, typeof (int));
result.Columns.Add (IsAliased, typeof (bool));
result.Columns.Add (IsExpression, typeof (bool));
result.Columns.Add (IsIdentity, typeof (bool));
result.Columns.Add (IsAutoIncrement, typeof (bool));
result.Columns.Add (IsRowVersion, typeof (bool));
result.Columns.Add (IsHidden, typeof (bool));
result.Columns.Add (IsLong, typeof (bool));
result.Columns.Add (IsReadOnly, typeof (bool));


Please, let me know if you are using any other metadata info so I can
add it accordingly.

Thanks in advance.




- --
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://gborg.postgresql.org/project/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -
Science without religion is lame;
religion without science is blind.

  ~ Albert Einstein
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQo30PP7iFmsNzeXfAQJaTwf9H85e6MGVDWo6uyE6jnewkaL5ivq7JS4z
6/Vvwwk3xmMkj5WhKcF2wQa9Zo4RWZYpTcmT5uoyYJl68Yl5puSnNinWeSa7h5rg
QTD9FXrhQ+IGvylGqS+U1reKC6JGJZC/A2fwJZPKYqjKh7MXutNy3cwERVzLqpYr
kSxHLdQt7kIPC5arpzcQMjOMAhg96X/03XxqnrupO7ACAdqyoC/uCfRGWte3+DDZ
UHg8Uka+OK0EsNPwVGUH7PpUWZp5Cn1qbiJ/eFJphaXTxZMLKKOTawvYVFI5lOxP
qCDe4RsFjosp4kYOkS+m9UtKbtr0vp2euY8+Y7l6TjyRADHNijemQg==
=BBjE
-END PGP SIGNATURE-

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-20 Thread Francisco Figueiredo Jr.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hubert FONGARNAND wrote:
 I've applied your patch...
 It corrects the problem with my postgresql app...

Hi Hubert!

What Npgsql version are you using??

I know that Konstantin patch adds much more reliability to the
DbDataAdapter code, but I'd like to know why Npgsql was failing when it
implements the required metadata info.

Thanks in advance.



- --
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://gborg.postgresql.org/project/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -
Science without religion is lame;
religion without science is blind.

  ~ Albert Einstein
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQo33f/7iFmsNzeXfAQJAhAf/Wg3q1Lk06E2usd/V/4i5n0ev/alXfXnr
9teLggzKuUD3YzV9aIe3cIQAHuTmEmb/ttW28hhNGUZ74WV8nJCLi0CO6brgHrE5
vIxxN4orHVSDU5Q+H/hCLlH7RJciqBhQK1vlQsVt9EH68l7NKLUkh28T7Xvf3WsK
/ivnPoa1eEN19i4qZaJKv6D1/gvGfDmK4Vap4Ltw48OKZVVCx23ugQmCBzBcK33f
pJ1uBUZ03YmPrYudtpBFGaxSgnOsroothix0U9oPXpmc8ZnYk3s1xWJb9lMsgzg9
FVWyyVuvZ719QaOYU21FHrxGbDPLifAZDQs/dK3uthaFfAFUFrfnwQ==
=vKWX
-END PGP SIGNATURE-

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-20 Thread Francisco Figueiredo Jr.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin Triger wrote:
 Hello Hubert,
 

Hi all!

 I'm completely agree that bugs are a bad thing, that's why I'm here to
 help you as soon as possible. The reason the DataAdapter code has
 changed is to solve other bugs, and the solution required some
 cooperation from providers too. Unfortunately it's not simple to make
 a complete testing over all the providers, so I do expect for some
 number of issues, but believe that with yours and others help we will
 stabilize the code very fast.
 

I totally agree here with Konstantine.
I apologize of not being very promptly but if there is anything else I
can do to help you, please let me know.

Thanks in advance.

- --
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://gborg.postgresql.org/project/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -
Science without religion is lame;
religion without science is blind.

  ~ Albert Einstein
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQo34qP7iFmsNzeXfAQJm1wf8Ducx3ZdSrkS6kpKtU/Hd4mHTCu34qbOq
dMh9qNf8EbFeHuDkavcyIq6Ow28hKUVCF9ydnGOO8n1uQxDAn6/Lk26GHPcuV8zB
xep6c2E1KjyLTehPLdP3fyas2grCzC6848oDbf1OYyBpSy1b6fRJssrGrJAi6WlC
cjdx9BEVDtOJQkVYX01rBG2pYl1xGIX5GTC3Pg0Z7WmTaXxj3PIrbv8LnAQAsaJh
LEq0ssvv7Wm1O0Tm/YH1EIpmUtZKJkZ4qtC6F8jaVLv2d+TblNyyyOFW0sPBupvK
rSzo9twA85Mct6rNmLIRvd95jleXIsSLEzLgG3MDlW+pW6rTgEjVJg==
=zRPt
-END PGP SIGNATURE-

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter... RESOLVED

2005-05-20 Thread Sureshkumar T
I guess the following is more proper fix. But, I am not sure why there
is no GetDateTimeSafe in ISafeRecord and is there any reason to leave
this to throw exception. Kosta could clear this.  Hubert, can you please
try this?

[SNIP]
Index: System.Data.Common/DataContainer.cs
===
--- System.Data.Common/DataContainer.cs (revision 44790)
+++ System.Data.Common/DataContainer.cs (working copy)
@@ -1069,7 +1069,8 @@
{
// if exception thrown, it should be
caught
// in the  caller method
-
base.SetValue(index,record.GetDateTime(field));
+this[index] = record.GetValue(field);
+

base.SetItemFromDataRecord(index,record,field);
}
[/SNIP]

suresh.

On Fri, 2005-05-20 at 12:36 +0200, Hubert FONGARNAND wrote:
 Hello
 
 I've found the last problems I had...
 The problem is when you do a fill with a null datetime in the result 
 dataset...
 the problem is in method  
 internal void ReadIDataRecord(int recordIndex, IDataRecord record, int[] 
 mapping, int length)
 of the record cache class
 this method do a call of :
   column.DataContainer.SetItemFromDataRecord(recordIndex, record,i);
 
 so the problem comes from the sealed class DateTimeDataContainer : 
 AbstractObjectDataContainer
 
 the method record.GetDateTime(field); throw a not well catched exception when 
 the datetime is null
 So, as a trick, i've added a try catch :
 
 my patch is :
 
 Index: DataContainer.cs
 ===
 --- DataContainer.cs(revision 44793)
 +++ DataContainer.cs(working copy)
 @@ -1069,7 +1069,15 @@
 {
 // if exception thrown, it should be caught
 // in the  caller method
 -   
 base.SetValue(index,record.GetDateTime(field));
 +   Object date=null;
 +   try
 +   {
 +date=record.GetDateTime(field);
 +   }catch
 +   {
 +   }
 +   base.SetValue(index,date);
 +
 
 base.SetItemFromDataRecord(index,record,field);
 }
 
 
 
 Le Mercredi 18 Mai 2005 11:32, vous avez écrit :
  Hello Hubert,
 
  I'm completely agree that bugs are a bad thing, that's why I'm here to
  help you as soon as possible. The reason the DataAdapter code has
  changed is to solve other bugs, and the solution required some
  cooperation from providers too. Unfortunately it's not simple to make
  a complete testing over all the providers, so I do expect for some
  number of issues, but believe that with yours and others help we will
  stabilize the code very fast.
 
  I would like to ask you several questions:
 
 1. Does your PG app work? If not, can you send the stack traces/code
samples of the problems?
 2. What is your current problem with Oracle? Can you please send a
stack? (It cannot be the same one because in my latest patch I
removed the calls to System.Data.DataRow:get_Item (System.String
columnName) from the BuildSchema).
 3. If it's possible, can you send your entire app, so I'll test it
here? (The confidentiality will be ensured).
 
  Thank you in advance for your patience and cooperation.
 
  Regards,
  Konstantin Triger
 
  Hubert FONGARNAND wrote:
  You're patch has nothing changes... I get always the same error...
  With the postgresql app... I can now login... but there's plenty of bugs
  inside... I think the best solution is to get an older version of Mono!
  
  Why do you include a patch if there's compatibility problems with data
  providers!!!
  
  thanks
  
  Le Mardi 17 Mai 2005 16:26, vous avez écrit :
  Hello again,
  
  Seems that Oracle provider does not initialize at all some columns in
  SchemaTable.
  The attached patch fixes that in a generic way.
  
  Regards,
  Konstantin Triger
  
  Hubert FONGARNAND wrote:
  I've applied your patch...
  It corrects the problem with my postgresql app...
  but i get always an error with the same app with oracle :
  
  System.IndexOutOfRangeException: Array index is out of range.
  in 0x00067 System.Data.DataRow:get_Item (System.String columnName,
  DataRowVersion version)
  in 0x00015 System.Data.DataRow:get_Item (System.String columnName)
  in 0x00495 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
  reader, System.Data.DataTable table, SchemaType schemaType,
  MissingSchemaAction missingSchAction, MissingMappingAction
  missingMapAction,
  System.Data.Common.DataTableMappingCollection dtMapping)
  in 0x00059 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
  reader, 

Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-18 Thread Hubert FONGARNAND
You're patch has nothing changes... I get always the same error...
With the postgresql app... I can now login... but there's plenty of bugs 
inside... I think the best solution is to get an older version of Mono!

Why do you include a patch if there's compatibility problems with data 
providers!!!

thanks

Le Mardi 17 Mai 2005 16:26, vous avez écrit :
 Hello again,

 Seems that Oracle provider does not initialize at all some columns in
 SchemaTable.
 The attached patch fixes that in a generic way.

 Regards,
 Konstantin Triger

 Hubert FONGARNAND wrote:
 I've applied your patch...
 It corrects the problem with my postgresql app...
 but i get always an error with the same app with oracle :
 
 System.IndexOutOfRangeException: Array index is out of range.
 in 0x00067 System.Data.DataRow:get_Item (System.String columnName,
 DataRowVersion version)
 in 0x00015 System.Data.DataRow:get_Item (System.String columnName)
 in 0x00495 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
  reader, System.Data.DataTable table, SchemaType schemaType,
  MissingSchemaAction missingSchAction, MissingMappingAction
  missingMapAction,
 System.Data.Common.DataTableMappingCollection dtMapping)
 in 0x00059 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
  reader, System.Data.DataTable table, SchemaType schemaType)
 in (wrapper remoting-invoke-with-check)
 System.Data.Common.DbDataAdapter:BuildSchema
 (System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType)
 in 0x00087 System.Data.Common.DbDataAdapter:FillTable
  (System.Data.DataTable dataTable, IDataReader dataReader, Int32
  startRecord, Int32 maxRecords, System.Int32 counter)
 in (wrapper remoting-invoke-with-check)
 System.Data.Common.DbDataAdapter:FillTable
 (System.Data.DataTable,System.Data.IDataReader,int,int,int)
 in 0x00117 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, System.String srcTable, IDataReader dataReader, Int32
  startRecord, Int32 maxRecords)
 in 0x000ce System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, Int32 startRecord, Int32 maxRecords, System.String srcTable,
 IDbCommand command, CommandBehavior behavior)
 in 0x00036 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
 dataSet, System.String srcTable)
 in (wrapper remoting-invoke-with-check)
  System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,string)
 in 0x00121 MoteurCRM.CProfil:RetourneGroupeCommercial (System.String
 cnxstring, System.String televendeur_Id)
 in 0x007e7 FicheClient.Logon:btnValider_Click (System.Object sender,
 System.EventArgs e)
 in (wrapper delegate-invoke)
 System.MulticastDelegate:invoke_void_object_EventArgs
 (object,System.EventArgs)
 
 Thanks...
 
 Le Mardi 17 Mai 2005 12:09, Konstantin Triger a écrit :
 Agreed, but in fact the provider should set the defaults, not the
 DataAdapter :-).
 
 Regards,
 Konstantin Triger
 
 Sureshkumar T wrote:
 + bool allowDBNull = 
 value is bool ? (bool)value : false;
 
 default allowDBNull should be true ;-)
 
 suresh.
 
 ___
 Ce message et les éventuels documents joints peuvent contenir des
  informations confidentielles. Au cas où il ne vous serait pas destiné,
  nous vous remercions de bien vouloir le supprimer et en aviser
  immédiatement l'expéditeur. Toute utilisation de ce message non conforme
  à sa destination, toute diffusion ou publication, totale ou partielle et
  quel qu'en soit le moyen est formellement interdite. Les communications
  sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas
  assurée et la société émettrice ne peut être tenue pour responsable de
  son contenu. ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Ce message et les éventuels documents joints peuvent contenir des informations 
confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir 
le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce 
message non conforme à sa destination, toute diffusion ou publication, totale 
ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce 
message n'est pas assurée et la société émettrice ne peut être tenue pour 
responsable de son contenu.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-18 Thread Konstantin Triger
Hello Hubert,
I'm completely agree that bugs are a bad thing, that's why I'm here to 
help you as soon as possible. The reason the DataAdapter code has 
changed is to solve other bugs, and the solution required some 
cooperation from providers too. Unfortunately it's not simple to make 
a complete testing over all the providers, so I do expect for some 
number of issues, but believe that with yours and others help we will 
stabilize the code very fast.

I would like to ask you several questions:
  1. Does your PG app work? If not, can you send the stack traces/code
 samples of the problems?
  2. What is your current problem with Oracle? Can you please send a
 stack? (It cannot be the same one because in my latest patch I
 removed the calls to System.Data.DataRow:get_Item (System.String
 columnName) from the BuildSchema).
  3. If it's possible, can you send your entire app, so I'll test it
 here? (The confidentiality will be ensured).
Thank you in advance for your patience and cooperation.
Regards,
Konstantin Triger

Hubert FONGARNAND wrote:
You're patch has nothing changes... I get always the same error...
With the postgresql app... I can now login... but there's plenty of bugs 
inside... I think the best solution is to get an older version of Mono!

Why do you include a patch if there's compatibility problems with data 
providers!!!

thanks
Le Mardi 17 Mai 2005 16:26, vous avez écrit :
 

Hello again,
Seems that Oracle provider does not initialize at all some columns in
SchemaTable.
The attached patch fixes that in a generic way.
Regards,
Konstantin Triger
Hubert FONGARNAND wrote:
   

I've applied your patch...
It corrects the problem with my postgresql app...
but i get always an error with the same app with oracle :
System.IndexOutOfRangeException: Array index is out of range.
in 0x00067 System.Data.DataRow:get_Item (System.String columnName,
DataRowVersion version)
in 0x00015 System.Data.DataRow:get_Item (System.String columnName)
in 0x00495 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
reader, System.Data.DataTable table, SchemaType schemaType,
MissingSchemaAction missingSchAction, MissingMappingAction
missingMapAction,
System.Data.Common.DataTableMappingCollection dtMapping)
in 0x00059 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader
reader, System.Data.DataTable table, SchemaType schemaType)
in (wrapper remoting-invoke-with-check)
System.Data.Common.DbDataAdapter:BuildSchema
(System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType)
in 0x00087 System.Data.Common.DbDataAdapter:FillTable
(System.Data.DataTable dataTable, IDataReader dataReader, Int32
startRecord, Int32 maxRecords, System.Int32 counter)
in (wrapper remoting-invoke-with-check)
System.Data.Common.DbDataAdapter:FillTable
(System.Data.DataTable,System.Data.IDataReader,int,int,int)
in 0x00117 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
dataSet, System.String srcTable, IDataReader dataReader, Int32
startRecord, Int32 maxRecords)
in 0x000ce System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
dataSet, Int32 startRecord, Int32 maxRecords, System.String srcTable,
IDbCommand command, CommandBehavior behavior)
in 0x00036 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet
dataSet, System.String srcTable)
in (wrapper remoting-invoke-with-check)
System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet,string)
in 0x00121 MoteurCRM.CProfil:RetourneGroupeCommercial (System.String
cnxstring, System.String televendeur_Id)
in 0x007e7 FicheClient.Logon:btnValider_Click (System.Object sender,
System.EventArgs e)
in (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_EventArgs
(object,System.EventArgs)
Thanks...
Le Mardi 17 Mai 2005 12:09, Konstantin Triger a écrit :
 

Agreed, but in fact the provider should set the defaults, not the
DataAdapter :-).
Regards,
Konstantin Triger
Sureshkumar T wrote:
   

+			bool allowDBNull = value is bool ? (bool)value : false;
   

default allowDBNull should be true ;-)
suresh.
 

___
Ce message et les éventuels documents joints peuvent contenir des
informations confidentielles. Au cas où il ne vous serait pas destiné,
nous vous remercions de bien vouloir le supprimer et en aviser
immédiatement l'expéditeur. Toute utilisation de ce message non conforme
à sa destination, toute diffusion ou publication, totale ou partielle et
quel qu'en soit le moyen est formellement interdite. Les communications
sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas
assurée et la société émettrice ne peut être tenue pour responsable de
son contenu. ___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
 

___
Ce message et les éventuels documents joints peuvent contenir des informations 

[Mono-devel-list] Problem with DbDataAdapter...

2005-05-17 Thread Hubert FONGARNAND
I've updated my mono this morning from SVN...
and all db applications (PostGreSQL) fails with : 


System.InvalidCastException: Cannot cast from source type to destination type.
in 0x00548 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader reader, 
System.Data.DataTable table, SchemaType schemaType, MissingSchemaAction 
missingSchAction, MissingMappingAction missingMapAction, 
System.Data.Common.DataTableMappingCollection dtMapping)
in 0x00059 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader reader, 
System.Data.DataTable table, SchemaType schemaType)
in (wrapper remoting-invoke-with-check) 
System.Data.Common.DbDataAdapter:BuildSchema 
(System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType)
in 0x00087 System.Data.Common.DbDataAdapter:FillTable (System.Data.DataTable 
dataTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, 
System.Int32 counter)
in (wrapper remoting-invoke-with-check) 
System.Data.Common.DbDataAdapter:FillTable 
(System.Data.DataTable,System.Data.IDataReader,int,int,int)
in 0x00117 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet 
dataSet, System.String srcTable, IDataReader dataReader, Int32 startRecord, 
Int32 maxRecords)
in 0x000ce System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet 
dataSet, Int32 startRecord, Int32 maxRecords, System.String srcTable, 
IDbCommand command, CommandBehavior behavior)
in 0x00036 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet 
dataSet, System.String srcTable)
in (wrapper remoting-invoke-with-check) System.Data.Common.DbDataAdapter:Fill 
(System.Data.DataSet,string)
in 0x00121 MoteurCRM.CProfil:RetourneGroupeCommercial (System.String 
cnxstring, System.String televendeur_Id)


what has been modified this week end

thanks
___
Ce message et les éventuels documents joints peuvent contenir des informations 
confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir 
le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce 
message non conforme à sa destination, toute diffusion ou publication, totale 
ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce 
message n'est pas assurée et la société émettrice ne peut être tenue pour 
responsable de son contenu.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-17 Thread Sureshkumar T
 + bool allowDBNull = 
 value is bool ? (bool)value : false;

default allowDBNull should be true ;-)

suresh.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-17 Thread Konstantin Triger
Agreed, but in fact the provider should set the defaults, not the 
DataAdapter :-).

Regards,
Konstantin Triger

Sureshkumar T wrote:
+			bool allowDBNull = value is bool ? (bool)value : false;
   

default allowDBNull should be true ;-)
suresh.
 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-devel-list] Problem with DbDataAdapter...

2005-05-17 Thread Konstantin Triger
Hello again,
Seems that Oracle provider does not initialize at all some columns in 
SchemaTable.
The attached patch fixes that in a generic way.

Regards,
Konstantin Triger

Hubert FONGARNAND wrote:
I've applied your patch...
It corrects the problem with my postgresql app...
but i get always an error with the same app with oracle :
System.IndexOutOfRangeException: Array index is out of range.
in 0x00067 System.Data.DataRow:get_Item (System.String columnName, 
DataRowVersion version)
in 0x00015 System.Data.DataRow:get_Item (System.String columnName)
in 0x00495 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader reader, 
System.Data.DataTable table, SchemaType schemaType, MissingSchemaAction 
missingSchAction, MissingMappingAction missingMapAction, 
System.Data.Common.DataTableMappingCollection dtMapping)
in 0x00059 System.Data.Common.DbDataAdapter:BuildSchema (IDataReader reader, 
System.Data.DataTable table, SchemaType schemaType)
in (wrapper remoting-invoke-with-check) 
System.Data.Common.DbDataAdapter:BuildSchema 
(System.Data.IDataReader,System.Data.DataTable,System.Data.SchemaType)
in 0x00087 System.Data.Common.DbDataAdapter:FillTable (System.Data.DataTable 
dataTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, 
System.Int32 counter)
in (wrapper remoting-invoke-with-check) 
System.Data.Common.DbDataAdapter:FillTable 
(System.Data.DataTable,System.Data.IDataReader,int,int,int)
in 0x00117 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet 
dataSet, System.String srcTable, IDataReader dataReader, Int32 startRecord, 
Int32 maxRecords)
in 0x000ce System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet 
dataSet, Int32 startRecord, Int32 maxRecords, System.String srcTable, 
IDbCommand command, CommandBehavior behavior)
in 0x00036 System.Data.Common.DbDataAdapter:Fill (System.Data.DataSet 
dataSet, System.String srcTable)
in (wrapper remoting-invoke-with-check) System.Data.Common.DbDataAdapter:Fill 
(System.Data.DataSet,string)
in 0x00121 MoteurCRM.CProfil:RetourneGroupeCommercial (System.String 
cnxstring, System.String televendeur_Id)
in 0x007e7 FicheClient.Logon:btnValider_Click (System.Object sender, 
System.EventArgs e)
in (wrapper delegate-invoke) 
System.MulticastDelegate:invoke_void_object_EventArgs 
(object,System.EventArgs)

Thanks...
Le Mardi 17 Mai 2005 12:09, Konstantin Triger a écrit :
 

Agreed, but in fact the provider should set the defaults, not the
DataAdapter :-).
Regards,
Konstantin Triger
Sureshkumar T wrote:
   

+			bool allowDBNull = value is bool ? (bool)value : false;
   

default allowDBNull should be true ;-)
suresh.
 

___
Ce message et les éventuels documents joints peuvent contenir des informations confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas assurée et la société émettrice ne peut être tenue pour responsable de son contenu.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
 

Index: System.Data.Common/DbDataAdapter.cs
===
--- System.Data.Common/DbDataAdapter.cs (revision 44571)
+++ System.Data.Common/DbDataAdapter.cs (working copy)
@@ -570,14 +570,25 @@
ArrayList primaryKey = new ArrayList ();
ArrayList sourceColumns = new ArrayList ();
bool createPrimaryKey = true;
+   
+   DataTable schemaTable = reader.GetSchemaTable ();
+   int colIndex;
+   DataColumn ColumnNameCol= ((colIndex = 
schemaTable.Columns.IndexOf(ColumnName)) = 0) ? 
schemaTable.Columns[colIndex] : null;
+   DataColumn DataTypeCol  = ((colIndex = 
schemaTable.Columns.IndexOf(DataType)) = 0) ? schemaTable.Columns[colIndex] 
: null;
+   DataColumn IsAutoIncrementCol   = ((colIndex = 
schemaTable.Columns.IndexOf(IsAutoIncrement)) = 0) ? 
schemaTable.Columns[colIndex] : null;
+   DataColumn AllowDBNullCol   = ((colIndex = 
schemaTable.Columns.IndexOf(AllowDBNull)) = 0) ? 
schemaTable.Columns[colIndex] : null;
+   DataColumn IsReadOnlyCol= ((colIndex = 
schemaTable.Columns.IndexOf(IsReadOnly)) = 0) ? 
schemaTable.Columns[colIndex] : null;
+   DataColumn IsKeyCol = 
((colIndex = schemaTable.Columns.IndexOf(IsKey)) = 0) ? 
schemaTable.Columns[colIndex] :