[Mono-list] DataBinding

Gonzalo Paniagua Javier gonzalo@ximian.com
02 May 2003 11:51:14 +0200


--=-Z5E+DkLD9fXAMBestPAW
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

El vie, 02 de 05 de 2003 a las 10:13, Jones, Larry escribió:
> Here is the aspx code:

Thanks Larry.

I've tried exactly that (ie, a DataGrid with autogenerated columns)
using a PostgreSQL database and found out that there was a little bug in
the automatic column generation. No hangs here, just an exception thrown
and the error displayed in the browser (an invalid cast).

It seems that Mono.Data.PostgreSqlClient has a bug too, but trying
Npgsql (after switching the authentication style from 'md5' to
'password'), displayed the data correctly.

I'm using current CVS version but I still think that you should get the
error page I got (due to that little bug that it's fixed now in CVS).

Please, upgrade to current CVS or apply the attached patch and try
again.

Thanks.

-Gonzalo

--=-Z5E+DkLD9fXAMBestPAW
Content-Disposition: attachment; filename=datagrid.patch
Content-Type: text/x-patch; name=datagrid.patch; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Index: DataGrid.cs
===================================================================
RCS file: /cvs/public/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs,v
retrieving revision 1.27
diff -u -r1.27 DataGrid.cs
--- DataGrid.cs	29 Mar 2003 12:47:24 -0000	1.27
+++ DataGrid.cs	2 May 2003 09:56:54 -0000
@@ -1343,9 +1343,10 @@
 					          BindingFlags.Instance | BindingFlags.Static |
 					          BindingFlags.Public, null, null,
 					          new Type[] { typeof(int) }, null);
+					
 					if(prop_item != null)
 					{
-						prop_type = prop_item.GetType();
+						prop_type = prop_item.PropertyType;
 					}
 					if(prop_type != null && prop_type == typeof(object))
 					{

--=-Z5E+DkLD9fXAMBestPAW--