[Mono-list] Bug in OdbcDataAdapter or DataSet ???

T Sureshkumar tsureshkumar@novell.com
Thu, 26 Aug 2004 01:26:29 -0600


Please file a bug in bugzilla at http://bugzilla.ximian.com under
System.Data to track the bug, if you have not done yet.

And, please attach all the code & dump you sent to mailing list.

thanks,
suresh.

>>> <beniniva@csr.unibo.it> 8/25/2004 6:46:10 PM >>>

Hi,
I've an asp.net web application that shows, through an odbc connection
to a
mysql database, the content of the table chosen from a DropDownList.
The code goes well on windows but on linux with mono 1.01 not all the
tables
are
shown correctly.
 
I've also tried to run a c# example that makes the same thing and it
works
well....so I think that is not a problem of mysql or odbc connection,
but
rather it may be a problem of odbcDataAdapter or Data set....
 
Is it true?
Could anybody help me?  

-------------------------
asp.net web application:
-------------------------
OdbcConnection conn = new OdbcConnection
("DRIVER=MySQL;SERVER=localhost;DATABASE=tdmio;UID=root;PASSWORD=rootpwd
;");
   OdbcDataAdapter daTabella = new OdbcDataAdapter("select * from "
+Tabella +
"", conn);
   DataSet Ds = new DataSet();
   conn.Open();
   daTabella.Fill(Ds, Tabella);
   conn.Close();
   DataGrid1.DataSource= Ds;
   DataGrid1.DataBind();

----------------------------
c# example:  
----------------------------
OdbcConnection conn = new OdbcConnection
("DRIVER=MySQL;SERVER=localhost;DATABASE=tdmio;UID=root;PASSWORD=rootpwd
");
   conn.Open();
   OdbcCommand com = new OdbcCommand();
   com = conn.CreateCommand();
   com.CommandText="Select * from " +nome+ "";
   OdbcDataReader dbReader =null;
   dbReader = com.ExecuteReader();
   Console.WriteLine();
   for (int i=0; i<dbReader.FieldCount;i++)
   {
    Console.Write("{0}",dbReader.GetName(i).PadLeft(10,' '));
   }
   Console.WriteLine();
   while (dbReader.Read())
   {
    for (int j=0;j<dbReader.FieldCount;j++)
    {
         Console.Write("{0}",
dbReader.GetValue(j).ToString().PadRight(20,'
'));
    }
    Console.WriteLine();
   }  
   dbReader.Close();
   conn.Close();
---------------------
 
Thanks a lot,
 
Valentina. 
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com 
http://lists.ximian.com/mailman/listinfo/mono-list