com.joybase.DB.dll源代码(5)

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
 /// <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, DBType DBType, string sourceColumn )
//  {
//   m_sParamName  = parameterName;
//   m_DBType    = DBType;
//   m_sSourceColumn = sourceColumn;
//  }
//
//  public DBType DBType
//  {
//   get  { return m_DBType; }
//   set  { m_DBType = value;  }
//  }
//
//  public ParameterDirection Direction
//  {
//   get { return m_direction; }
//   set { m_direction = value; }
//  }
//
//  public Boolean IsNullable
//  {
//   get { return m_fNullable; }
//  }
//
//  public String ParameterName
//  {
//   get { return m_sParamName; }
//   set { m_sParamName = value; }
//  }
//
//  public String SourceColumn
//  {
//   get { return m_sSourceColumn; }
//   set { m_sSourceColumn = value; }
//  }
//
//  public DataRowVersion SourceVersion
//  {
//   get { return m_sourceVersion; }
//   set { m_sourceVersion = value; }
//  }
//
//  public object Value
//  {
//   get
//   {
//    return m_value;
//   }
//   set
//   {
//    m_value    = value;
//    m_DBType  = _inferType(value);
//   }
//  }
//
//  private DBType _inferType(Object value)
//  {
//   switch (Type.GetTypeCode(value.GetType()))
//   {
//    case TypeCode.Empty:
//     throw new SystemException("Invalid data type");
//
//    case TypeCode.Object:
//     return DBType.Object;
//
//    case TypeCode.DBNull:
//    case TypeCode.Char:
//    case TypeCode.SByte:
//    case TypeCode.UInt16:
//    case TypeCode.UInt32:
//    case TypeCode.UInt64:
//     // Throw a SystemException for unsupported data types.
//     throw new SystemException("Invalid data type");
//
//    case TypeCode.Boolean:
//     return DBType.Boolean;
//
//    case TypeCode.Byte:
//     return DBType.Byte;
//
//    case TypeCode.Int16:
//     return DBType.Int16;
//
//    case TypeCode.Int32:
//     return DBType.Int32;
//
//    case TypeCode.Int64:
//     return DBType.Int64;
//
//    case TypeCode.Single:
//     return DBType.Single;
//
//    case TypeCode.Double:
//     return DBType.Double;
//
//    case TypeCode.Decimal:
//     return DBType.Decimal;
//
//    case TypeCode.DateTime:
//     return DBType.DateTime;
//
//    case TypeCode.String:
//     return DBType.String;
//
//    default:
//     throw new SystemException("Value is of unknown data type");
//   }
//  }
// }
//
// public class DBParameters: System.Collections.ArrayList,IDataParameterCollection
// {
//  //private DBParameter x[int];
////  public object this[string index]
////  {
////   get;set;
////  }
//
//  public object this[string index]
//  {
//   get
//   {
//    
//    return this[IndexOf(index)];
//   }
//   set
//   {
//    this[IndexOf(index)] = value;
//   }
//  }
//
//
////  public DBParameter this[string x]
////  {
////   get
////   {
////   }
////   set
////   {
////   }
////  }
////  public DBParameter this[string index]
////  {
////   get
////   {
////    return (DBParameter)this[IndexOf(index)];
////    
////    
////   }
////   set
////   {
////    this[IndexOf(index)]=value;
////   }
////  }
////  public DBParameter this[int index]
////  {
////   get
////   {
////    return (DBParameter)this[index];
////   }
////   set
////   {
////    this[index]=value;
////   }
////  }
//
//  public bool Contains(string parameterName)
//  {
//   return(-1 != IndexOf(parameterName));
//   
//  }
//
//  public int IndexOf(string parameterName)
//  {
//   int index = 0;
//   foreach(System.Data.IDataParameter item in this)
//   {
//    if (0 == _cultureAwarecompare(item.ParameterName,parameterName))
//    {
//     return index;
//    }
//    index++;
//   }
//   return -1;
//  }
//
//  public void RemoveAt(string parameterName)
//  {
//   RemoveAt(IndexOf(parameterName));
//  }
//
//  public override int Add(object value)
//  {
//   return Add((DBParameter)value);
//  }
//
//  public int Add(DBParameter valueIn)
//  {
//   if (valueIn.ParameterName != null)
//   {
//    return base.Add(valueIn);
//   }
//   else
//    throw new ArgumentException("parameter must be named");
//  }
//
//  public int Add(string parameterName, System.Data.DBType type)
//  {
//   return Add(new DBParameter(parameterName, type));
//  }
//
//  public int Add(string parameterName, object value)
//  {
//   return Add(new DBParameter(parameterName, value));
//  }
//
//  public int Add(string parameterName, DBType DBType, string sourceColumn)
//  {
//   return Add(new DBParameter(parameterName, DBType, sourceColumn));
//  }
//
//  private int _cultureAwarecompare(string strA, string strB)
//  {
//   return System.Globalization.CultureInfo.CurrentCulture.compareInfo.compare(strA, strB, System.Globalization.compareOptions.IgnoreKanaType | compareOptions.IgnoreWidth | compareOptions.IgnoreCase);
//  }
//
//  
//
//  
// }
// public abstract class datareader:system.data.idatareader
// {
//  public abstract int depth {get;}
//  public abstract bool isclosed{get;}
//  public abstract int recordsaffected{get;}
//  public abstract void close();
//  public abstract bool nextresult();
//  public abstract bool read();
//  public abstract datatable getschematable();
//  public abstract int fieldcount{get;}
//  public abstract string getname(int i);
//  public abstract string getdatatypename(int i);
//  public abstract type getfieldtype(int i);
//  public abstract object getvalue(int i);
//  public abstract int getvalues(object[] values);
//  public abstract int getordinal(string name);
//  public abstract object this [ int i ]{get;}
//  public abstract object this [ string name ]{get;}
//  public abstract bool getboolean(int i);
//  public abstract byte getbyte(int i);
//  public abstract long getbytes(int i, long fieldoffset, byte[] buffer, int bufferoffset, int length);
//  public abstract char getchar(int i);
//  public abstract long getchars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length);
//  public abstract guid getguid(int i);
//  public abstract int16 getint16(int i);
//  public abstract int32 getint32(int i);
//  public abstract int64 getint64(int i);
//  public abstract float getfloat(int i);
//  public abstract double getdouble(int i);
//  public abstract string getstring(int i);
//  public abstract decimal getdecimal(int i);
//  public abstract datetime getdatetime(int i);
//  public abstract idatareader getdata(int i);
//  public abstract bool isDBnull(int i);
//  public abstract void dispose();
//  //private abstract int _cultureawarecompare(string stra, string strb);
//  
// }

}

11AIJb030525c.jpg
seover="window.status='正文--com.joybase.DB.dll源代码(5)';return true">
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: .net
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭