[Mono-aspnet-list] GridView/ Databinding bug in Mono 2.10.5

H . test051102 at hotmail.com
Fri Sep 16 09:34:37 EDT 2011



Databinding in Mono is different
compared to .Net Framework. I have observed this within a complex web
application. Below you will find the steps to create a small example
web app that demonstrates the issue:



Create an ASP.NET project
	Add a GridView to Default.aspx
	Add an SqlDataSource to
	Default.aspx and connect it to the GridView
	Set the ConnectionString property
	to a valid network connection via an ODBC database driver
	Do not define the SelectCommand
	property
	Add an event handler
	SqlDataSource1_Selecting() which should be called whenever a
	databindung operation ocurrs.
	Put a breakpoint in
	SqlDataSource1_Selecting() to verify if databinding takes place




If you run the application in Visual
Studio, you will notice that SqlDataSource1_Selecting() is never
called. But if you run the application in Mono 2.10.5
SqlDataSource1_Selecting() is called which will result in an
exception because the SelectCommand property is actually not defined.



It is common practice not to define the
SelectCommand property within the .aspx file but rather calulate the
actual query string within the code behind. Defineing the
SelectCommand property within the .aspx file requires the use of ODBC
parameters. However, Mono does currently not support this (see bug
#694047 -> reported 4 months ago but not resolved yet). As a result we are forced to use the code behind method in
Mono if we need to access a database via ODBC.


Best regards,Martin

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20110916/db354f91/attachment-0001.html 


More information about the Mono-aspnet-list mailing list