GoogleGearsSQLLiteDB和C#

GoogleGearsSQLLiteDB和C#,c#,google-gears,C#,Google Gears,在封面下,谷歌齿轮使用SQLLite作为其数据存储。是否有人使用C#成功连接到Google Gears SQL Lite数据库 谢谢//嗨,试试这个: //Courtesy of http://www.codoxide.com/post/My-Favorite-Database-Wrapper-for-C.aspx using System; using System.Collections.Generic; using System.Text; using System.Data; using

在封面下,谷歌齿轮使用SQLLite作为其数据存储。是否有人使用C#成功连接到Google Gears SQL Lite数据库

谢谢

//嗨,试试这个:

//Courtesy of http://www.codoxide.com/post/My-Favorite-Database-Wrapper-for-C.aspx
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;

namespace GenApp.Core.Providers.nsDb
{
    //comm -- / <summary>
    //comm -- / Abstract base class for encapsulating provider independant database interactin logic. 
    //comm -- / </summary>
    //comm -- / <typeparam name="CONNECTION_TYPE"><see cref="DbConnection"/> derived Connection type.</typeparam>
    //comm -- / <typeparam name="COMMAND_TYPE"><see cref="DbCommand"/> derived Command type.</typeparam>
    //comm -- / <typeparam name="ADAPTER_TYPE"><see cref="DbDataAdapater"/> derived Data Adapter type.</typeparam>
    public abstract 
        class AbstractDatabase<CONNECTION_TYPE, COMMAND_TYPE, ADAPTER_TYPE> : IDisposable
        where CONNECTION_TYPE : DbConnection, new()
        where COMMAND_TYPE : DbCommand
        where ADAPTER_TYPE : DbDataAdapter, new()
    {
        #region : Connection :

        //comm -- / <summary>Gets the Connection object associated with the current instance.</summary>
        public DbConnection Connection
        {
            get
            {
                if (internal_currentConnection == null)
                {
                    internal_currentConnection = new CONNECTION_TYPE();
                                        // - Enable to measure the connection timeGenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf ( ref userObj , "GetConnectionString START" );
                    internal_currentConnection.ConnectionString = GetConnectionString();
                                        // - Enable to measure the connection timeGenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf ( ref userObj , "GetConnectionString END" );
                }
                return internal_currentConnection;
            }
        }
        private DbConnection internal_currentConnection;

        //comm -- / <summary>When overridden in derived classes returns the connection string for the database.</summary>
        //comm -- / <returns>The connection string for the database.</returns>
        protected abstract string GetConnectionString();

        #endregion

        #region : Commands :

        //comm -- / <summary>Gets a DbCommand object with the specified <see cref="DbCommand.CommandText"/>.</summary>
        //comm -- / <param name="sqlString">The SQL string.</param>
        //comm -- / <returns>A DbCommand object with the specified <see cref="DbCommand.CommandText"/>.</returns>
        public DbCommand GetSqlStringCommand(string sqlString)
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();

            DbCommand cmd  = this.Connection.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = sqlString;
            return cmd;
        }

        //comm -- / <summary>Gets a DbCommand object with the specified <see cref="DbCommand.CommandText"/>.</summary>
        //comm -- / <param name="sqlStringFormat">The SQL string format.</param>
        //comm -- / <param name="args">The format arguments.</param>
        //comm -- / <returns>A DbCommand object with the specified <see cref="DbCommand.CommandText"/>.</returns>
        public DbCommand GetSqlStringCommand(string sqlStringFormat, params object[] args)
        {
            return GetSqlStringCommand(string.Format(sqlStringFormat, args));
        }

        //comm -- / <summary>Gets a DbCommand object for the specified Stored Procedure.</summary>
        //comm -- / <param name="storedProcName">The name of the stored procedure.</param>
        //comm -- / <returns>A DbCommand object for the specified Stored Procedure.</returns>
        public DbCommand GetStoredProcedureCommand(string storedProcName)
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();

            DbCommand cmd    = this.Connection.CreateCommand();
            cmd.CommandType   = CommandType.StoredProcedure;
            cmd.CommandText   = storedProcName;
            return cmd;
        }

        #region : Parameters :

        //comm -- / <summary>Adds an input parameter to the given <see cref="DbCommand"/>.</summary>
        //comm -- / <param name="cmd">The command object the parameter should be added to.</param>
        //comm -- / <param name="paramName">The identifier of the parameter.</param>
        //comm -- / <param name="paramType">The type of the parameter.</param>
        //comm -- / <param name="value">The value of the parameter.</param>
        //comm -- / <returns>The <see cref="DbParameter"/> that was created.</returns>
        public DbParameter AddInParam(DbCommand cmd, string paramName, DbType paramType, object value)
        {
            DbParameter param       = cmd.CreateParameter();
            param.DbType            = paramType;
            param.ParameterName     = paramName;
            param.Value             = value;
            param.Direction         = ParameterDirection.Input;
            cmd.Parameters.Add( param );
            return param;
                } //eof method AddInParam

        //comm -- / <summary>Adds an input parameter to the given <see cref="DbCommand"/>.</summary>
        //comm -- / <param name="cmd">The command object the parameter should be added to.</param>
        //comm -- / <param name="paramName">The identifier of the parameter.</param>
        //comm -- / <param name="paramType">The type of the parameter.</param>
        //comm -- / <param name="size">The maximum size in bytes, of the data table column to be affected.</param>
        //comm -- / <param name="value">The value of the parameter.</param>
        //comm -- / <returns>The <see cref="DbParameter"/> that was created.</returns>
        public DbParameter AddInParam(DbCommand cmd, string paramName, DbType paramType, int size, object value)
        {
            DbParameter param       = cmd.CreateParameter();
            param.DbType            = paramType;
            param.ParameterName     = paramName;
            param.Size              = size;
            param.Value             = value;
            param.Direction         = ParameterDirection.Input;
            //debugGenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf ( ref userObj , "Adding IN param " + value.ToString ( ) );
            cmd.Parameters.Add(param);
            return param;
        }

        public DbParameter AddInOutParam ( DbCommand cmd, string paramName, DbType paramType, int size, object value )
            {
            DbParameter param = cmd.CreateParameter ( );
            param.DbType = paramType;
            param.ParameterName = paramName;
            param.Size = size;
            param.Value = value;
            param.Direction = ParameterDirection.Output;
            cmd.Parameters.Add ( param );
            //debug if needed here 
            return param;
            }


        public DbParameter AddInOutParam ( DbCommand cmd, string paramName, DbType paramType, object value )
            {
            DbParameter param = cmd.CreateParameter ( );
            param.DbType = paramType;
            param.ParameterName = paramName;
            param.Value = value;
            param.Direction = ParameterDirection.Output;
            cmd.Parameters.Add ( param );
            return param;
            }

        #endregion

        #region : Executes :

        //comm -- / <summary>Executes the specified command against the current connection.</summary>
        //comm -- / <param name="cmd">The command to be executed.</param>
        //comm -- / <returns>Result returned by the database engine.</returns>
        public int ExecuteNonQuery(DbCommand cmd)
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();

            return cmd.ExecuteNonQuery();
        }

        //comm -- / <summary>Executes the specified command against the current connection.</summary>
        //comm -- / <param name="cmd">The command to be executed.</param>
        //comm -- / <param name="txn">The database transaction inside which the command should be executed.</param>
        //comm -- / <returns>Result returned by the database engine.</returns>
        public int ExecuteNonQuery(DbCommand cmd, DbTransaction txn)
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();

            cmd.Transaction = txn;
            return cmd.ExecuteNonQuery();
        }

        //comm -- / <summary>Executes the specified command against the current connection.</summary>
        //comm -- / <param name="cmd">The command to be executed.</param>
        //comm -- / <returns>Result returned by the database engine.</returns>
        public DbDataReader ExecuteReader(DbCommand cmd)
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();

            return cmd.ExecuteReader();
        }

        //comm -- / <summary>Executes the specified command against the current connection.</summary>
        //comm -- / <param name="cmd">The command to be executed.</param>
        //comm -- / <param name="behavior">One of the <see cref="System.Data.CommandBehavior"/> values.</param>
        //comm -- / <returns>Result returned by the database engine.</returns>
        public DbDataReader ExecuteReader(DbCommand cmd ,  CommandBehavior behavior )
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();

            return cmd.ExecuteReader(behavior);
        }

        //comm -- / <summary>Executes the specified command against the current connection.</summary>
        //comm -- / <param name="cmd">The command to be executed.</param>
        //comm -- / <returns>Result returned by the database engine.</returns>
        public T ExecuteScalar<T>(DbCommand cmd, T defaultValue)
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();

            object retVal = cmd.ExecuteScalar();
            if (null == retVal || DBNull.Value == retVal)
                return defaultValue;
            else
                return (T)retVal;
        }

        //comm -- / <summary>Executes the specified command against the current connection.</summary>
        //comm -- / <param name="cmd">The command to be executed.</param>
        //comm -- / <returns>Result returned by the database engine.</returns>
        public DataSet ExecuteDataSet(DbCommand cmd)
        {
            ADAPTER_TYPE adapter  = new ADAPTER_TYPE();
            adapter.SelectCommand = (COMMAND_TYPE)cmd;


            DataSet retVal = new DataSet();
            adapter.Fill(retVal);
            return retVal;
        }

        ////comm -- / <summary>Executes the specified command against the current connection.</summary>
        ////comm -- / <param name="cmd">The command to be executed.</param>
        ////comm -- / <returns>Result returned by the database engine.</returns>
        //public DataSet ExecuteDataSet(DbCommand cmd )
        //{
        //  ADAPTER_TYPE adapter = new ADAPTER_TYPE();
        //  adapter.SelectCommand = (COMMAND_TYPE)cmd;
        //  //cmd.CommandTimeout = 3600
        //  DataSet retVal = new DataSet();
        //  adapter.Fill(retVal);
        //  return retVal;
        //}

        #endregion

        #endregion

        //comm -- / <summary>Begins a transaction.</summary>
        //comm -- / <returns>Created transaction.</returns>
        public DbTransaction BeginTransaction()
        {
            if (this.Connection.State != ConnectionState.Open)
                this.Connection.Open();
            return Connection.BeginTransaction();
        }

        #region : Construction / Destruction :

        //comm -- / <summary>Disposes the resources associated with the current database connection.</summary>
        ~AbstractDatabase()
        {
            Dispose();
        }

        #region IDisposable Members

        //comm -- / <summary>Disposes the resources associated with the current database connection.</summary>
        public void Dispose()
        {
            if (null != internal_currentConnection)
            {
                internal_currentConnection.Dispose();
                internal_currentConnection = null;
            }
        }

        #endregion

        #endregion

    } //eof public abstract class AbstractDatabase
} //eof namespace Providers.nsDb 


using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;


namespace GenApp.Core.Providers.nsDb
{
    public class Database : AbstractDatabase<SqlConnection, SqlCommand, SqlDataAdapter>
    {




                    private string _ConnectionString;
                    public string ConnectionString
                    {
                        get { return _ConnectionString; }
                        set { _ConnectionString = value; }
                    } //eof property FieldName 

                    public Database ( string connectionStr )
                    {
            //debugGenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf(ref userObj , " CHECK --- nsDb.Database using the following connection string " + connectionStr);
                        this.ConnectionString = connectionStr; 
                    } //eof constructor 


            protected override string GetConnectionString ( )
            {

                //GenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf ( ref userObj , "In GetConnectionString the ConnectionString is " + this.ConnectionString );
                //GenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf ( ref userObj , "The comming fromURL IS " + commingFromURL );
                return this._ConnectionString;
            } //eof protected override string GetConnectionString()

    } //eof class 
} //eof namespace Providers.nsDb
//由http://www.codoxide.com/post/My-Favorite-Database-Wrapper-for-C.aspx
使用制度;
使用System.Collections.Generic;
使用系统文本;
使用系统数据;
使用System.Data.Common;
命名空间GenApp.Core.Providers.nsDb
{
//通信--/
//comm--/Abstract基类,用于在逻辑中封装与提供程序无关的数据库。
//通信--/
//通信--/派生连接类型。
//命令--/派生命令类型。
//通信--/派生数据适配器类型。
公开摘要
类抽象数据库:IDisposable
其中连接类型:DbConnection,new()
where命令类型:DbCommand
其中适配器类型:DbDataAdapter,new()
{
#地区:连接:
//comm--/获取与当前实例关联的连接对象。
公共数据库连接
{
得到
{
if(内部_currentConnection==null)
{
内部连接=新连接类型();
//-启用测量连接timeGenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf(参考userObj,“GetConnectionString启动”);
内部_currentConnection.ConnectionString=GetConnectionString();
//-启用测量连接timeGenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf(参考userObj,“GetConnectionString结束”);
}
返回内部连接;
}
}
专用DbConnection内部_currentConnection;
//comm--/When在派生类中重写时返回数据库的连接字符串。
//comm--/数据库的连接字符串。
受保护的抽象字符串GetConnectionString();
#端区
#区域:命令:
//comm--/获取具有指定值的DbCommand对象。
//comm--/SQL字符串。
//comm--/DbCommand对象,具有指定的。
公共DbCommand GetSqlStringCommand(字符串sqlString)
{
if(this.Connection.State!=ConnectionState.Open)
this.Connection.Open();
DbCommand cmd=this.Connection.CreateCommand();
cmd.CommandType=CommandType.Text;
cmd.CommandText=sqlString;
返回cmd;
}
//comm--/获取具有指定值的DbCommand对象。
//comm--/SQL字符串格式。
//comm--/format参数。
//comm--/DbCommand对象,具有指定的。
public DbCommand GetSqlStringCommand(字符串sqlStringFormat,参数对象[]args)
{
返回GetSqlStringCommand(string.Format(sqlStringFormat,args));
}
//comm--/获取指定存储过程的DbCommand对象。
//comm--/存储过程的名称。
//comm--/DbCommand对象,用于指定的存储过程。
公共数据库命令GetStoredProcedureCommand(字符串storedProcName)
{
if(this.Connection.State!=ConnectionState.Open)
this.Connection.Open();
DbCommand cmd=this.Connection.CreateCommand();
cmd.CommandType=CommandType.storedProcess;
cmd.CommandText=storedProcName;
返回cmd;
}
#地区:参数:
//comm--/将输入参数添加到给定的。
//comm--/参数应添加到的命令对象。
//comm--/参数的标识符。
//comm--/参数的类型。
//comm--/参数的值。
//comm--/已创建的。
公共DbParameter AddInParam(DbCommand cmd、字符串paramName、DbType paramType、对象值)
{
DbParameter param=cmd.CreateParameter();
param.DbType=paramType;
param.ParameterName=paramName;
参数值=值;
参数方向=参数方向输入;
cmd.Parameters.Add(param);
返回参数;
}//eof方法AddInParam
//comm--/将输入参数添加到给定的。
//comm--/参数应添加到的命令对象。
//comm--/参数的标识符。
//comm--/参数的类型。
//comm--/受影响的数据表列的最大大小(以字节为单位)。
//comm--/参数的值。
//comm--/已创建的。
公共DbParameter AddInParam(DbCommand cmd、字符串paramName、DbType paramType、int size、对象值)
{
DbParameter param=cmd.CreateParameter();
param.DbType=paramType;
param.ParameterName=paramName;
参数大小=大小;
参数值=值;
参数方向=参数方向输入;
//debugGenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf(参考userObj,“添加参数”+value.ToString());
cmd.Parameters.Add(param);
返回参数;
}
公共DbParameter AddInOutParam(DbCommand cmd、字符串paramName、DbType paramType、int size、对象值)
{
DbParameter param=cmd.CreateParameter();
param.DbType=paramType;
param.ParameterName=paramName;
参数大小=大小;
参数值=值;
参数方向=参数方向输出;
cmd.Parameters.Add(param);
        #region Action
        try
        {
            using (Database db = new Database ( _ConnectionString ))
            {
                DbCommand cmd = db.GetStoredProcedureCommand ( procedureName );
                db.AddInParam ( cmd, "@domain_user", DbType.String, (object)domainName );

                GenApp.Core.Providers.nsDbMeta.DbDebugger.WriteIf ( ref userObj , "METHOD START --- MetaDbControl.cs RunProcGetDs + \n" );


                ds = db.ExecuteDataSet ( cmd );
                Utils.Debugger.DebugDataSet("from RunProcGetDs ", ref ds);

                //debug msg = "Select the values for your reports";
                return true;
            } //eof using
        } //eof try
        #endregion Action


        #region CatchExceptionsAdv4
        catch (NullReferenceException nre)
        {
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace ();
            string methodName = st.GetFrame ( 1 ).GetMethod ().Name;
            string className = st.GetFrame ( 1 ).GetFileName ();
            int lineNumber = st.GetFrame ( 1 ).GetFileLineNumber ();

            string encryptedErrorCode = String.Empty;
            encryptedErrorCode += "className - " + className + " methodName ";
            encryptedErrorCode += methodName + " lineNumber " + lineNumber.ToString ();
            encryptedErrorCode += userObj.DomainName;

            if (System.Convert.ToInt16 ( BL.Conf.Instance.Vars["EncryptErrorMessages"] ) == 1)
                encryptedErrorCode = Utils.DataEncryption.EncryptString ( encryptedErrorCode, userObj.DomainName );


            userObj.Mc.Msg = "An error in the application occurred. Report the following error code " + encryptedErrorCode;
            userObj.Mc.ClassName += className + " ; " ;
            userObj.Mc.MethodName += methodName + " ; " ;
            userObj.Mc.DebugMsg += nre.Message;

            if (DbDebugger.DebugAppError ( ref userObj ) == false)
            {
                userObj.Mc.Msg = "Failed to debug application error at " + methodName;
        catch (System.InvalidOperationException ioe) //comm -- occurs when no result set was found !!!
        {
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace ();
            string methodName = st.GetFrame ( 1 ).GetMethod ().Name;
            string className = st.GetFrame ( 1 ).GetFileName ();
            int lineNumber = st.GetFrame ( 1 ).GetFileLineNumber ();

            string encryptedErrorCode = String.Empty;
            encryptedErrorCode += "className - " + className + " methodName ";
            encryptedErrorCode += methodName + " lineNumber " + lineNumber.ToString ();
            encryptedErrorCode += userObj.DomainName;

            if (System.Convert.ToInt16 ( BL.Conf.Instance.Vars["EncryptErrorMessages"] ) == 1)
                encryptedErrorCode = Utils.DataEncryption.EncryptString ( encryptedErrorCode, userObj.DomainName );


            userObj.Mc.Msg = "An error in the application occurred. Report the following error code " + encryptedErrorCode;
            userObj.Mc.ClassName += className + " ; " ;
            userObj.Mc.MethodName += methodName + " ; " ;
            userObj.Mc.DebugMsg += ioe.Message;

            if (DbDebugger.DebugAppError ( ref userObj ) == false)
            {
                userObj.Mc.Msg = "Failed to debug application error at " + methodName;
        catch (System.IndexOutOfRangeException ioore) //comm -- occurs when no result set was found !!!
        {
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace ();
            string methodName = st.GetFrame ( 1 ).GetMethod ().Name;
            string className = st.GetFrame ( 1 ).GetFileName ();
            int lineNumber = st.GetFrame ( 1 ).GetFileLineNumber ();

            string encryptedErrorCode = String.Empty;
            encryptedErrorCode += "className - " + className + " methodName ";
            encryptedErrorCode += methodName + " lineNumber " + lineNumber.ToString ();
            encryptedErrorCode += userObj.DomainName;

            if (System.Convert.ToInt16 ( BL.Conf.Instance.Vars["EncryptErrorMessages"] ) == 1)
                encryptedErrorCode = Utils.DataEncryption.EncryptString ( encryptedErrorCode, userObj.DomainName );


            userObj.Mc.Msg = "An error in the application occurred. Report the following error code " + encryptedErrorCode;
            userObj.Mc.ClassName += className + " ; " ;
            userObj.Mc.MethodName += methodName + " ; " ;
            userObj.Mc.DebugMsg += ioore.Message;

            if (DbDebugger.DebugAppError ( ref userObj ) == false)
            {
                userObj.Mc.Msg = "Failed to debug application error at " + methodName;
        catch (System.Data.SqlClient.SqlException sqle)
        {
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace ();
            string methodName = st.GetFrame ( 1 ).GetMethod ().Name;
            string className = st.GetFrame ( 1 ).GetFileName ();
            int lineNumber = st.GetFrame ( 1 ).GetFileLineNumber ();

            string encryptedErrorCode = String.Empty;
            encryptedErrorCode += "className - " + className + " methodName ";
            encryptedErrorCode += methodName + " lineNumber " + lineNumber.ToString ();
            encryptedErrorCode += userObj.DomainName;

            if (System.Convert.ToInt16 ( BL.Conf.Instance.Vars["EncryptErrorMessages"] ) == 1)
                encryptedErrorCode = Utils.DataEncryption.EncryptString ( encryptedErrorCode, userObj.DomainName );


            userObj.Mc.Msg = "An error in the application occurred. Report the following error code " + encryptedErrorCode;
            userObj.Mc.ClassName += className + " ; " ;
            userObj.Mc.MethodName += methodName + " ; " ;
            userObj.Mc.DebugMsg += sqle.Message;

            if (DbDebugger.DebugAppError ( ref userObj ) == false)
            {
                userObj.Mc.Msg = "Failed to debug application error at " + methodName;
        catch (System.FormatException fe)
        {
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace ();
            string methodName = st.GetFrame ( 1 ).GetMethod ().Name;
            string className = st.GetFrame ( 1 ).GetFileName ();
            int lineNumber = st.GetFrame ( 1 ).GetFileLineNumber ();

            string encryptedErrorCode = String.Empty;
            encryptedErrorCode += "className - " + className + " methodName ";
            encryptedErrorCode += methodName + " lineNumber " + lineNumber.ToString ();
            encryptedErrorCode += userObj.DomainName;

            if (System.Convert.ToInt16 ( BL.Conf.Instance.Vars["EncryptErrorMessages"] ) == 1)
                encryptedErrorCode = Utils.DataEncryption.EncryptString ( encryptedErrorCode, userObj.DomainName );


            userObj.Mc.Msg = "An error in the application occurred. Report the following error code " + encryptedErrorCode;
            userObj.Mc.ClassName += className + " ; " ;
            userObj.Mc.MethodName += methodName + " ; " ;
            userObj.Mc.DebugMsg += fe.Message;

            if (DbDebugger.DebugAppError ( ref userObj ) == false)
            {
                userObj.Mc.Msg = "Failed to debug application error at " + methodName;
        catch (Exception ex)
        {
            System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace ();
            string methodName = st.GetFrame ( 1 ).GetMethod ().Name;
            string className = st.GetFrame ( 1 ).GetFileName ();
            int lineNumber = st.GetFrame ( 1 ).GetFileLineNumber ();

            string encryptedErrorCode = String.Empty;
            encryptedErrorCode += "className - " + className + " methodName ";
            encryptedErrorCode += methodName + " lineNumber " + lineNumber.ToString ();
            encryptedErrorCode += userObj.DomainName;

            if (System.Convert.ToInt16 ( BL.Conf.Instance.Vars["EncryptErrorMessages"] ) == 1)
                encryptedErrorCode = Utils.DataEncryption.EncryptString ( encryptedErrorCode, userObj.DomainName );


            userObj.Mc.Msg = "An error in the application occurred. Report the following error code " + encryptedErrorCode;
            userObj.Mc.ClassName += className + " ; " ;
            userObj.Mc.MethodName += methodName + " ; " ;
            userObj.Mc.DebugMsg += ex.Message;

            if (DbDebugger.DebugAppError ( ref userObj ) == false)
            {
                userObj.Mc.Msg = "Failed to debug application error at " + methodName;
    } //eof method