本文整理汇总了C#中OleDbType类的典型用法代码示例。如果您正苦于以下问题:C# OleDbType类的具体用法?C# OleDbType怎么用?C# OleDbType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OleDbType类属于命名空间,在下文中一共展示了OleDbType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: genParameter
protected DbParameter genParameter(String paramName, OleDbType type, int size, Object value)
{
if (value == null)
value = DBNull.Value;
DbParameter param = null;
if (type == OleDbType.DBTimeStamp)
{
if (value == DBNull.Value)
{
param = new OleDbParameter(paramName, value);
}
else
{
param = new OleDbParameter(paramName, ((Nullable<DateTime>)value).Value);
}
}
else
{
param = new OleDbParameter(paramName, type, size);
param.Value = value;
}
return param;
}
示例2: AddOutParamToSqlCommand
public static OleDbParameter AddOutParamToSqlCommand(OleDbCommand comm, string pName, OleDbType pType)
{
OleDbParameter param = new OleDbParameter(pName, pType);
param.Direction = ParameterDirection.Output;
comm.Parameters.Add(param);
return param;
}
示例3: GetDbType
/// <summary>
/// Returns the matching DBType for this OleDBtype
/// </summary>
/// <param name="type">OleDbType to convert</param>
/// <returns>Corresponding DbType</returns>
public static DbType GetDbType(OleDbType type)
{
if (!typeLookup.ContainsKey(type))
return default(DbType); // Default is ANSIString = 0
return typeLookup[type];
}
示例4: OleDbField
public OleDbField(int tableIndex, string fieldName, OleDbType dataType, bool visible)
{
this.tabIndex = tableIndex;
this.fldName = fieldName;
this.dbType = dataType;
this.visible = visible;
}
示例5: button2_Click
private void button2_Click(object sender, EventArgs e)
{
if (isNumber(tbSwim.Text.Trim()))
{
string name = "PACK_BANKNET.Proc_ExceptionHold_Comeback";
string[] InParaName = new string[1] { "v1_swim_id" };
string[] OutParaName = new string[1] { "v2_out_ret" };
OleDbType[] InParaType = new OleDbType[1] { OleDbType.Numeric };
OleDbType[] OutParaType = new OleDbType[1] { OleDbType.Numeric };
string[] InParaValues = new string[1] { tbSwim.Text.Trim() };
string[] OutParaValues = new string[1];
for (int i = 0; i < 1; i++)
OutParaValues[i] = "";
int[] OutParaSize = new int[1] { 0 };
string err = "";
this.Cursor = Cursors.WaitCursor;
Businessbp.executedb.ExecuteProcTCBS(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err);
this.Cursor = Cursors.Default;
if (err != "")
MessageBox.Show(err);
else
{
if (OutParaValues[0].ToString() == "-1")
{
MessageBox.Show("Proccess unsuccessful.");
}
else
{
MessageBox.Show("Proccess successful.");
}
}
}
else
MessageBox.Show("Invalid swim id");
}
示例6: button2_Click
private void button2_Click(object sender, EventArgs e)
{
string name = "PACK_BANKNET.Proc_Release";
string[] InParaName = new string[1] { "v1_swim_id" };
string[] OutParaName = new string[1] { "v2_out_ret" };
OleDbType[] InParaType = new OleDbType[1] { OleDbType.Numeric };
OleDbType[] OutParaType = new OleDbType[1] { OleDbType.Numeric };
string[] InParaValues = new string[1] { swim_id };
string[] OutParaValues = new string[1];
for (int i = 0; i < 1; i++)
OutParaValues[i] = "";
int[] OutParaSize = new int[1] { 0 };
string err = "";
this.Cursor = Cursors.WaitCursor;
Businessbp.executedb.ExecuteProcTCBS(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err);
this.Cursor = Cursors.Default;
if (err != "")
MessageBox.Show(err);
else
{
if (OutParaValues[0].ToString() == "-1")
{
tbStatus.Text = "Release unsuccessful.";
MessageBox.Show("Release unsuccessful.");
}
else
{
tbStatus.Text = "Release successful.";
MessageBox.Show("Release successful.");
button2.Enabled = false;
}
}
}
示例7: ExecuteSqlParameter
public ExecuteSqlParameter(string name, string variableName, ParameterDirections direction, OleDbType oleDBType, int length)
{
Name = name;
VariableName = variableName;
Direction = direction;
OleDBType = oleDBType;
Length = length;
}
示例8: AddParameter
public OleDbParameter AddParameter(string ParameterName, OleDbType type, int size, object value, ParameterDirection direction)
{
OleDbParameter param = new OleDbParameter(ParameterName, type, size);
param.Direction = direction;
param.Value = value;
Command.Parameters.Add(param);
return param;
}
示例9: IsOleDbTypeValidForIDCol
public static bool IsOleDbTypeValidForIDCol(OleDbType ot)
{
if (ot == OleDbType.Integer
|| ot == OleDbType.BigInt
|| ot == OleDbType.SmallInt
|| ot == OleDbType.TinyInt
|| ot == OleDbType.Guid) return true;
else return false;
}
示例10: button2_Click
private void button2_Click(object sender, EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;
string sql = "", err1 = "";
DataTable dt;
string name = Businessbp.executedb.owner + "proc_check88";
// proc_check88(
//fromdate in varchar2,
//todate in varchar2,
//r_count out number,
//Result_out out number,
//Emsg_out out varchar2)
string FromDate = "", ToDate = "";
FromDate = dtFrom.Text + " " + tbFhh.Text + ":" + tbFmi.Text + ":" + tbFss.Text;
ToDate = dtTo.Text + " " + tbThh.Text + ":" + tbTmi.Text + ":" + tbTss.Text;
string[] InParaName = new string[2] { "fromdate", "todate" };
string[] OutParaName = new string[3] { "r_count", "Result_out", "Emsg_out" };
OleDbType[] InParaType = new OleDbType[2] { OleDbType.VarChar, OleDbType.VarChar };
OleDbType[] OutParaType = new OleDbType[3] { OleDbType.Numeric, OleDbType.Numeric, OleDbType.VarChar };
string[] InParaValues = new string[2] { FromDate, ToDate };
string[] OutParaValues = new string[3];
for (int i = 0; i < 3; i++)
OutParaValues[i] = "";
int[] OutParaSize = new int[3] { 0 , 0 , 300 };
string err = "";
Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err);
if (err != "")
MessageBox.Show(err);
else
{
int r_count = Int32.Parse(OutParaValues[0].ToString());
int Result_out = Int32.Parse(OutParaValues[1].ToString());
string Emsg_out = OutParaValues[2].ToString();
if (Result_out != 1)
{
MessageBox.Show(Emsg_out);
return;
}
else
{
MessageBox.Show("Process successfull!!!");
LoadData();
}
}
this.Cursor = Cursors.Default;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
示例11: ColumnDefinition
public ColumnDefinition(String name, bool primaryKey,
bool foreignKey, bool unique, bool nullable, OleDbType type)
{
_name = name;
_primaryKey = primaryKey;
_foreignKey = foreignKey;
_unique = unique;
_nullable = nullable;
_type = type;
}
示例12: ColumnInfo
public ColumnInfo(string name, long ordinalPosition, OleDbType dbType, long? characterMaxLength, int? numericPrecision, int? numericScale, bool isPrimaryKey = false)
{
Name = name;
OrdinalPosition = ordinalPosition;
DbType = dbType;
CharacterMaxLength = characterMaxLength;
NumericPrecision = numericPrecision;
NumericScale = numericScale;
IsPrimaryKey = isPrimaryKey;
}
示例13: Process
private void Process()
{
try
{
this.Cursor = Cursors.WaitCursor;
string name = "";
const int out_para = 2;
name += "" + Businessbp.executedb.owner + "proc_nab_thucno";
//string type = "Pre_Transaction_Upload";
string in_parameter = "";
string[] InParaName = new string[1] { "user_id" };
string[] OutParaName = new string[out_para] { "Result_out", "Emsg_out" };
OleDbType[] InParaType = new OleDbType[2] { OleDbType.VarChar, OleDbType.VarChar };
OleDbType[] OutParaType = new OleDbType[out_para] { OleDbType.Numeric, OleDbType.VarChar};
string[] InParaValues = new string[1] { Businessbp.executedb.Usrid };
string[] OutParaValues = new string[out_para];
for (int i = 0; i < out_para; i++)
OutParaValues[i] = "";
int[] OutParaSize = new int[out_para] { 0, 500};
string err = "";
Businessbp.executedb.ExecuteProcELECTRA(name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err);
if (err != "")
{
MessageBox.Show(err);
this.Cursor = Cursors.Default;
return;
}
else
{
int Result_out = Int32.Parse(OutParaValues[0].ToString());
string Emsg_out = OutParaValues[1].ToString();
if (Result_out != 1)
{
MessageBox.Show(Emsg_out);
tbStatus.Text = Emsg_out;
this.Cursor = Cursors.Default;
return;
}
else
{
//Parse out_parameter nếu cần thiết
tbStatus.Text = "Successfull!!!";
MessageBox.Show("Successfull!!!");
}
}
this.Cursor = Cursors.Default;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
this.Cursor = Cursors.Default;
}
}
示例14: btProcess_Click
private void btProcess_Click( object sender, EventArgs e )
{
try
{
string type = cbb_type.Text.Trim ( ); //2015-10-20 (1)
this.Cursor = Cursors.WaitCursor;
string name = Businessbp.executedb.owner + "pro_auto_payment";
//string[] InParaName = new string[1] { "u_create" };//old 2015-10-20 (1)
string[] InParaName = new string[1] { "u_create" };//2015-10-20 (1)
string[] OutParaName = new string[2] { "Result_out", "Msg_out" };
//OleDbType[] InParaType = new OleDbType[1] { OleDbType.VarChar };//old 2015-10-20 (1)
OleDbType[] InParaType = new OleDbType[1] { OleDbType.VarChar };//2015-10-20 (1)
OleDbType[] OutParaType = new OleDbType[2] { OleDbType.Numeric, OleDbType.VarChar };
//string[] InParaValues = new string[1] { Businessbp.executedb.Usrid };//old 2015-10-20 (1)
string[] InParaValues = new string[1] { Businessbp.executedb.Usrid };// 2015-10-20 (1)
string[] OutParaValues = new string[2];
for (int i = 0; i < 2; i++)
OutParaValues[i] = "";
int[] OutParaSize = new int[2] { 0, 300 };
string err = "";
Businessbp.executedb.ExecuteProcELECTRA ( name, InParaName, InParaType, InParaValues, OutParaName, OutParaType, OutParaSize, ref OutParaValues, ref err );
if (err != "")
{
MessageBox.Show ( err );
this.Cursor = Cursors.Default;
}
else
{
int Result_out = Int32.Parse ( OutParaValues[0].ToString ( ) );
string Emsg_out = OutParaValues[1].ToString ( );
if (Result_out != 1)//Lỗi
{
MessageBox.Show ( Emsg_out );
this.Cursor = Cursors.Default;
return;
}
else
{
//Xu ly hach toan
HachToan ( false );
LoadData ( );
tbStatus.Text = "Process successfull!!!";
this.Cursor = Cursors.Default;
}
}
}
catch (Exception ex)
{
MessageBox.Show ( ex.Message );
}
}
示例15: SetParameterValue
void SetParameterValue(OleDbParameterCollection Params, object value, OleDbType type)
{
if (value != null)
{
Params.Add("?", type).Value = value;
}
else
{
Params.AddWithValue("?", DBNull.Value);
}
}