[Mono-bugs] [Bug 693041] New: Exception caused by SqlDataSource
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed May 11 04:14:48 EDT 2011
https://bugzilla.novell.com/show_bug.cgi?id=693041
https://bugzilla.novell.com/show_bug.cgi?id=693041#c0
Summary: Exception caused by SqlDataSource
Classification: Mono
Product: Mono: Class Libraries
Version: 2.10.x
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Web
AssignedTo: mhabersack at novell.com
ReportedBy: test051102 at hotmail.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101
Firefox/4.0.1
Exception caused by SqlDataSource
Analysis
#####################
If a page contains a GridView which is connected to SqlDataSource which has
it's SelectCommand not defined, Mono throws an exception. This does not happend
under .Net Framework.
It is sometimes useful to set the SelectCommand property within the code-behind
file. Consider a search engine where the user has to open the search page
containg a GridView, a SqlDataSource and a TextBox to enter the search term. In
this case, it doesn't makes sense to set the SqlDataSource's SelectCommand
property within the .aspx file. Mono does currently not support this behaviour.
Solution
#####################
GridView.DataBind() is called when loading the page. GridView.DataBind() calls
SqlDataSourceView.ExecuteSelect() which is responsible for accessing the
database and executing the query. However, in case the SelectCommand is not
defined, Mono must to try to access the database in any way. The following code
would help when beeing inserted at the beginning of
SqlDataSourceView.ExecuteSelect()
if(String.IsNullOrEmpty(SelectCommand))
return null;
Reproducible: Always
Steps to Reproduce:
1. Run example project under native .Net Framework
2. Run example project under Mono 2.10.2
3. Compare the results
Actual Results:
Mono throws an exception where .Net Framework does not
Expected Results:
No exeption
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list