[Mono-list] adapter.Fill(dataset)

Mohammad DAMT md@mt.web.id
Tue, 27 Jan 2004 14:28:34 +0700


Hmm, I experience the same...
I went investigate this, and found that in Fill method in DBDataAdapter
there are:
...
                dataTable.BeginLoadData ();
                //dataTable.LoadDataRow (itemArray,
AcceptChangesDuringFill);
                dataTable.LoadDataRow (tableArray,
AcceptChangesDuringFill);
                dataTable.EndLoadData ();
...
 

the dataTable.EndLoadData (); threw this exception:

System.InvalidOperationException: The comparer threw an exception --->
System.NotImplementedException: The requested feature is not yet
implemented
in <0x00030> System.Collections.CaseInsensitiveHashCodeProvider:.ctor
(System.Globalization.CultureInfo)
in <0x00073> System.Data.UniqueConstraint:CalcHashValue
(System.Data.DataRow,bool)
in <0x00086> .RowsComparer:Compare (object,object)
in <0x0008f> System.Array:compare
(object,object,System.Collections.IComparer)
in <0x00084> System.Array:qsort
(System.Array,System.Array,int,int,System.Collections.IComparer)
in <0x0021a> System.Array:Sort
(System.Array,System.Array,int,int,System.Collections.IComparer)
--- End of inner exception stack trace ---
  
in <0x00258> System.Array:Sort
(System.Array,System.Array,int,int,System.Collections.IComparer)
in <0x00075> System.Array:Sort
(System.Array,System.Collections.IComparer)
in <0x0015f> System.Data.UniqueConstraint:AssertConstraint ()
in <0x00153> System.Data.DataSet:set_EnforceConstraints (bool)
in <0x0004c> System.Data.DataTable:EndLoadData ()
in <0x003db> System.Data.Common.DbDataAdapter:Fill
(System.Data.DataSet,string,System.Data.IDataReader,int,int)
  

unfortunately, the CaseInsensitiveHashCodeProvider (CultureInfo culture)
ctor is not implemented. For temporary, you can comment out the
exception in
mcs/class/corlib/System.Collections.CaseInsensitiveHashCodeProvider.cs
to be look like this

		public CaseInsensitiveHashCodeProvider (CultureInfo culture)
		{
			//throw new NotImplementedException ();
		}

sorry no patch, I'm not familiar with case insensitive string
comparison.

On Rab, 2004-01-21 at 08:42, Carlo "Jedi" wrote:
> Hi all, I'm new in this mailing list and I have a great problem:
> 
> I'm using Mono 0.29 (but I've tried also earlier versions, cvs and daily 
> builds), MySQL 4.0.17 (but I've tried also earlier versions) and ByteFX Data 
> Provider (the one included in Mono and also ver 0.74 and earlier versions).
> 
> My problem is that when I do "adapter.Fill(dataset)" only first two records 
> are stored even if table has 5,10,100,n records. 
> I've tested the "select" and it is working fine, so problem seems to be 
> located in fill method. 
> This is my code:
> 
> ###############################################
> MySqlConnection myConnection = new MySqlConnection();
> try
> {
> myConnection.ConnectionString = "Server=myserver;database=mydb;User 
> ID=mylogin;password=mypass;";
> myConnection.Open();
> MySqlCommand myCommand = new MySqlCommand("SELECT idServizio FROM TServizi 
> where IdPadre=0",myConnection);
> MySqlDataAdapter adapter = new MySqlDataAdapter();
> adapter.SelectCommand = myCommand;
> DataSet myDs = new DataSet();
> adapter.Fill(myDs);
> Console.WriteLine("myDs.Tables[0].Rows.Count);
> myConnection.Dispose();
> }
> catch (Exception e)
> {
> Console.WriteLine(e.ToString()); 
> }
> 
> ###############################################
> 
> Could you help me? I've also tried to connect to MsSQL instead of MySQL and it 
> works fine, so problem really seems to be ByteFX... is there any other data 
> provider for mono/mysql??? Thank you in advance.
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>