コード例 #1
0
        public override string Delim(string val, DelimType dt)
        {
            switch (dt)
            {
            case DelimType.Parameter:
                return('@' + val);

            case DelimType.String:
                return("'" + val.Replace("'", "''") + "'");

            default:
                return('`' + val.Replace("`", "``") + '`');
            }
        }
コード例 #2
0
 public bool Check(DelimType typ)
 {
     foreach (Pullenti.Ner.MetaToken d in Delims)
     {
         if ((d is DelimToken) && (((d as DelimToken).Typ & typ)) != DelimType.Undefined)
         {
             return(true);
         }
         else if ((d is Pullenti.Ner.Core.ConjunctionToken) && typ == DelimType.And)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
ファイル: Database.cs プロジェクト: REMSLogic/REMSLogic
 public override string Delim(string input, DelimType type)
 {
     switch (type)
     {
     case DelimType.Database:
     case DelimType.Schema:
     case DelimType.Table:
     case DelimType.Column:
         return '[' + input + ']';
     case DelimType.Parameter:
         return '@' + input;
     case DelimType.String:
         return '"' + input.Replace("\"", "\\\"") + '"';
     default:
         throw new Exception("Unrecognized [DelimType].[" + type.ToString() + "].");
     }
 }
コード例 #4
0
ファイル: DatabaseConnector.cs プロジェクト: FallenAvatar/PIN
 public abstract string Delim(string val, DelimType dt);