Click here to Skip to main content
12,501,479 members (48,610 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads

Stats

44.5K views
309 downloads
15 bookmarked
Posted

Race to Linux - Race 3: Reports Starter Kit using Mono SqlServer/Firebird

, 30 Sep 2005
Reports Starter Kit port to Linux using Mono
RaceToLinuxRace3_src
bin
ASPNET.StarterKit.Reports.dll
FirebirdSql.Data.Firebird.dll
Components
BLL
DAL
docs
images
1x1.gif
crosstabnestedcontrols.png
crosstabtotals.png
customers.gif
drilldownnestedcontrols.png
employees.gif
getorderdetails.gif
getorders.gif
hierarchicalpaging.gif
hierarchicalreport.gif
hierarchicalschema.gif
hierarchicalsorting.gif
masterdetaildetails.png
masterdetailsummary.png
masterdetailtables.png
querysample.gif
querysample2.gif
simpleoverview.png
simplesp.png
tabdetail.png
tabheader.gif
tabheader.png
tabnestedcontrols.png
tabularcolorcode.png
tabularextendedprice.png
tabularsorting.png
textshot.gif
viscategorysales.gif
viscategorysales.png
vischartstructure.png
xtabsql.png
global.asax
images
asp.net-reports.gif
background.gif
crosstab.gif
drilldown.gif
grid_background.gif
hierarchical.gif
logo-neg.gif
logo.gif
masterdetail.gif
masterdetails.gif
report-table-bg.gif
simple.gif
spacer.gif
tabular.gif
textalternate.gif
textreport.gif
visual.gif
ReportsCSVS.csproj.webinfo
SourceViewer
1x1.gif
crosstab.src
drilldown.src
grid_background.gif
hierarchical.src
masterdetail.src
simple.src
tabular.src
textreport.src
visual.src
REPORTS.BKP
using System;
using System.Configuration;
using FirebirdSql.Data.Firebird;
using System.Data;
using System.Data.SqlClient;

namespace ASPNET.StarterKit.Reports.DataAccessLayer
{
	public sealed class DatabaseHelper
	{
		public static int ExecuteNonQuery(string connectionString, CommandType commandType, string commandText, params IDataParameter[] commandParameters)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteNonQuery(connectionString, commandType, commandText, commandParameters as FbParameter[]);
			else
				return SqlHelper.ExecuteNonQuery(connectionString, commandType, commandText, commandParameters as SqlParameter[]);
		}

		public static int ExecuteNonQuery(string connectionString, string spName, params object[] parameterValues)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteNonQuery(connectionString, spName, parameterValues);
			else
				return SqlHelper.ExecuteNonQuery(connectionString, spName, parameterValues);
		}

		
		public static int ExecuteNonQuery(IDbConnection connection, CommandType commandType, string commandText, params IDataParameter[] commandParameters)
		{	
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteNonQuery(connection as FbConnection, commandType, commandText, commandParameters as FbParameter[]);
			else
				return SqlHelper.ExecuteNonQuery(connection as SqlConnection, commandType, commandText, commandParameters as SqlParameter[]);
		}

		public static DataSet ExecuteDataset(string connectionString, CommandType commandType, string commandText, params IDataParameter[] commandParameters)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteDataset(connectionString, commandType, commandText, commandParameters as FbParameter[]);
			else
				return SqlHelper.ExecuteDataset(connectionString, commandType, commandText, commandParameters as SqlParameter[]);
		}

		public static DataSet ExecuteDataset(string connectionString, string spName, params object[] parameterValues)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteDataset(connectionString, spName, parameterValues);
			else
				return SqlHelper.ExecuteDataset(connectionString, spName, parameterValues);
		}
		
		public static DataSet ExecuteDataset(IDbConnection connection, CommandType commandType, string commandText, params IDataParameter[] commandParameters)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteDataset(connection as FbConnection, commandType, commandText, commandParameters as FbParameter[]);
			else
				return SqlHelper.ExecuteDataset(connection as SqlConnection, commandType, commandText, commandParameters as SqlParameter[]);
		}

		public static object ExecuteScalar(string connectionString, CommandType commandType, string commandText, params IDataParameter[] commandParameters)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteScalar(connectionString, commandType, commandText, commandParameters as FbParameter[]);
			else
				return SqlHelper.ExecuteScalar(connectionString, commandType, commandText, commandParameters as SqlParameter[]);
		}

		public static object ExecuteScalar(string connectionString, string spName, params object[] parameterValues)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteScalar(connectionString, spName, parameterValues);
			else
				return SqlHelper.ExecuteScalar(connectionString, spName, parameterValues);
		}

		public static object ExecuteScalar(IDbConnection connection, CommandType commandType, string commandText, params IDataParameter[] commandParameters)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteScalar(connection as FbConnection, commandType, commandText, commandParameters as FbParameter[]);	
			else
				return SqlHelper.ExecuteScalar(connection as SqlConnection, commandType, commandText, commandParameters as SqlParameter[]);	
		}

		public static object ExecuteScalar(IDbTransaction transaction, string spName, params object[] parameterValues)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
				return FbHelper.ExecuteScalar(transaction as FbTransaction, spName, parameterValues);
			else
				return SqlHelper.ExecuteScalar(transaction as SqlTransaction, spName, parameterValues);
		}

		public static IDbConnection GetConnection(string connectionString)
		{
			if (ConfigurationSettings.AppSettings[Global.CfgKeyProvider]=="FireBird")
			{
				FbConnection ret=new FbConnection(connectionString);
				ret.Open();
				return ret;
			}
			else
			{
				SqlConnection ret=new SqlConnection(connectionString);
				ret.Open();
				return ret;
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

idepaula
Web Developer
Uruguay Uruguay
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 1 Oct 2005
Article Copyright 2005 by idepaula
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid