From ef6f021f9ccdcea831360618f5207e1274a0ef23 Mon Sep 17 00:00:00 2001 From: Peter Forstmeier Date: Thu, 13 May 2010 10:20:51 +0000 Subject: [PATCH] Fix http://community.sharpdevelop.net/forums/t/10738.aspx git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/reports@5813 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../ICSharpCode.Reports.Core/Project/ConnectionObject.cs | 2 ++ .../Project/DataManager/SqlDataAccess.cs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs index 638ee12d70..d15123ac04 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/ConnectionObject.cs @@ -74,6 +74,8 @@ namespace ICSharpCode.Reports.Core { } + public string QueryString {get;set;} + public IDbConnection Connection { get { diff --git a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs index b5b12f2653..cb0dce1b02 100644 --- a/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs +++ b/src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/DataManager/SqlDataAccess.cs @@ -64,7 +64,13 @@ namespace ICSharpCode.Reports.Core } IDbCommand command = this.connectionObject.Connection.CreateCommand(); - command.CommandText = reportSettings.CommandText; + + if (String.IsNullOrEmpty(this.connectionObject.QueryString)) { + command.CommandText = reportSettings.CommandText; + } else { + command.CommandText = this.connectionObject.QueryString; + } + command.CommandType = reportSettings.CommandType; // We have to check if there are parameters for this Query, if so // add them to the command