Exemple #1
0
        private MySqlParameter GetParameter(SqlHelperParameter sqlHelperParameter)
        {
            MySqlParameter mysqlParameter = new MySqlParameter();
            MySqlDbType    mysqlDbType    = MySqlDbType.VarChar;

            switch (sqlHelperParameter.DataType)
            {
            case ParamsType.Varchar:
                mysqlDbType = MySqlDbType.VarChar;
                break;

            case ParamsType.Int:
                mysqlDbType = MySqlDbType.Int16;
                break;

            case ParamsType.DateTime:
                mysqlDbType = MySqlDbType.Date;
                break;

            case ParamsType.Decimal:
                mysqlDbType = MySqlDbType.Decimal;
                break;

            case ParamsType.Blob:
                mysqlDbType = MySqlDbType.Blob;
                break;
            }
            mysqlParameter.ParameterName = sqlHelperParameter.Name;
            mysqlParameter.MySqlDbType   = mysqlDbType;
            mysqlParameter.Direction     = sqlHelperParameter.Direction;
            mysqlParameter.Value         = sqlHelperParameter.Value;
            mysqlParameter.Size          = sqlHelperParameter.Size;
            return(mysqlParameter);
        }
Exemple #2
0
        private OracleParameter GetParameter(SqlHelperParameter sqlHelperParameter)
        {
            OracleParameter oracleParameter = new OracleParameter();
            OracleDbType    oracleDbType    = OracleDbType.Varchar2;

            switch (sqlHelperParameter.DataType)
            {
            case ParamsType.Varchar:
                oracleDbType = OracleDbType.Varchar2;
                break;

            case ParamsType.Int:
                oracleDbType = OracleDbType.Int16;
                break;

            case ParamsType.DateTime:
                oracleDbType = OracleDbType.Date;
                break;

            case ParamsType.Decimal:
                oracleDbType = OracleDbType.Decimal;
                break;

            case ParamsType.Blob:
                oracleDbType = OracleDbType.Blob;
                break;
            }
            oracleParameter.ParameterName = sqlHelperParameter.Name;
            oracleParameter.OracleDbType  = oracleDbType;
            oracleParameter.Direction     = sqlHelperParameter.Direction;
            oracleParameter.Value         = sqlHelperParameter.Value;
            oracleParameter.Size          = sqlHelperParameter.Size;
            return(oracleParameter);
        }
Exemple #3
0
        private SqlParameter GetParameter(SqlHelperParameter sqlHelperParameter)
        {
            SqlParameter sqlParameter = new SqlParameter();
            DbType       dbType       = DbType.String;

            switch (sqlHelperParameter.DataType)
            {
            case ParamsType.Varchar:
                dbType = DbType.String;
                break;

            case ParamsType.Int:
                dbType = DbType.Int16;
                break;

            case ParamsType.DateTime:
                dbType = DbType.DateTime;
                break;

            case ParamsType.Decimal:
                dbType = DbType.Decimal;
                break;

            case ParamsType.Blob:
                dbType = DbType.Binary;
                break;
            }
            sqlParameter.ParameterName = sqlHelperParameter.Name;
            sqlParameter.DbType        = dbType;
            sqlParameter.Direction     = sqlHelperParameter.Direction;
            sqlParameter.Value         = sqlHelperParameter.Value;
            sqlParameter.Size          = sqlHelperParameter.Size;
            return(sqlParameter);
        }
Exemple #4
0
        private SQLiteParameter GetParameter(SqlHelperParameter sqlHelperParameter)
        {
            SQLiteParameter result = new SQLiteParameter();

            return(result);
        }