日期:2012-06-17  浏览次数:20422 次

 /// <summary>
/// 枚举类型,即一个数据库连接类型的枚举
/// </summary>
public enum DBType
{
  /// <summary>
  /// SQL方式连接
  /// </summary>
  SqlClient=0,
  /// <summary>
  /// OLEDB方式连接
  /// </summary>
  OleDB=1
}
/// <summary>
/// 本程序集的异常信息
/// </summary>
public class JoyBaseDBException:Exception
{
  /// <summary>
  /// 构造方法
  /// </summary>
  public JoyBaseDBException():base()
  {
   this.HelpLink="http://www.joycode.com";
   this._Reason="无特定原因";
  }
  /// <summary>
  /// 构造方法
  /// </summary>
  /// <param name="message">错误信息</param>
  public JoyBaseDBException(string message):base("com.joybase.DB.dll Exception Message:"+message)
  {
   //this.Message=message;
   this._Reason="无特定原因";
   this.HelpLink="http://www.joycode.com";
  }
  /// <summary>
  /// 构造方法
  /// </summary>
  /// <param name="message">错误信息</param>
  /// <param name="e">内部异常</param>
  public JoyBaseDBException(string message,System.Exception e):base("com.joybase.DB.dll Exception Message:"+message,e)
  {
   //this.Message=;
   this.HelpLink="http://www.joycode.com";
   this._Reason="无特定原因";
  }
  /// <summary>
  /// 构造方法
  /// </summary>
  /// <param name="message">错误信息</param>
  /// <param name="reason">错误原因</param>
  public JoyBaseDBException(string message,string reason):base("com.joybase.DB.dll Exception Message:"+message+".更多信息请捕捉本异常的Reason变量")
  {
   this._Reason="可能原因如下:\r\n"+reason;
  }
  private string _Reason;
  /// <summary>
  /// 错误原因,只读
  /// </summary>
  public string Reason
  {
   get
   {
    return this._Reason;
   }
  }
  
}
// /// <summary>
// ///
// /// </summary>
// public class DBParameter:IDataParameter
// {
//  DbType m_dbType  = DbType.Object;
//  ParameterDirection m_direction = ParameterDirection.Input;
//  bool m_fNullable  = false;
//  string m_sParamName;
//  string m_sSourceColumn;
//  DataRowVersion m_sourceVersion = DataRowVersion.Current;
//  object m_value;
//
//  public DBParameter()
//  {
//  }
//
//  public DBParameter(string parameterName, DbType type)
//  {
//   m_sParamName = parameterName;
//   m_dbType   = type;
//  }
//
//  public DBParameter(string parameterName, object value)
//  {
//   m_sParamName = parameterName;
//   this.Value = value;   
//   // Setting the value also infers the type.
//  }
//
//  public DBParameter( string parameterName, D