示例#1
0
 private static void PopulateBinaryParameter(
     DbParameter parameter,
     TypeUsage type,
     DbType dbType,
     bool isOutParam)
 {
     parameter.DbType = dbType;
     DbCommandDefinition.SetParameterSize(parameter, type, isOutParam);
 }
示例#2
0
        private static void PopulateStringParameter(
            DbParameter parameter,
            TypeUsage type,
            bool isOutParam)
        {
            bool isUnicode     = true;
            bool isFixedLength = false;

            if (!TypeHelpers.TryGetIsFixedLength(type, out isFixedLength))
            {
                isFixedLength = false;
            }
            if (!TypeHelpers.TryGetIsUnicode(type, out isUnicode))
            {
                isUnicode = true;
            }
            parameter.DbType = !isFixedLength ? (isUnicode ? DbType.String : DbType.AnsiString) : (isUnicode ? DbType.StringFixedLength : DbType.AnsiStringFixedLength);
            DbCommandDefinition.SetParameterSize(parameter, type, isOutParam);
        }