Com.joybase.DB.dll source Code (5)

Source: Internet
Author: User
Tags abstract bool datetime
Source Code///<summary>
Enumeration type, that is, an enumeration of database connection types
</summary>
public enum DBType
{
<summary>
SQL Mode Connection
</summary>
Sqlclient=0,
<summary>
OLE DB Mode connection
</summary>
Oledb=1
}
<summary>
Exception information for this Assembly
</summary>
public class Joybasedbexception:exception
{
<summary>
Construction method
</summary>
Public joybasedbexception (): Base ()
{
This. helplink= "http://www.joycode.com";
this._reason= "no specific Reason";
}
<summary>
Construction method
</summary>
<param name= "message" > Error information </param>
Public joybasedbexception (String message): Base ("Com.joybase.DB.dll Exception message:" +message)
{
This. Message=message;
this._reason= "no specific Reason";
This. helplink= "http://www.joycode.com";
}
<summary>
Construction method
</summary>
<param name= "message" > Error information </param>
<param name= "E" > Internal anomaly </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= "no specific Reason";
}
<summary>
Construction method
</summary>
<param name= "message" > Error information </param>
<param name= "Reason" > Error reason </param>
Public joybasedbexception (String message,string reason): Base ("Com.joybase.DB.dll Exception message: +message+". For more information, catch this exception's reason variable ")
{
This._reason= "Possible causes are as follows: \ r \ n" +reason;
}
private string _reason;
<summary>
Error reason, read only
</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;}
This is public abstract object [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);
//
// }

}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.