示例#1
0
        protected override String GetParemetrized()
        {
            // Field=@Field1 ,Field2,...


            StringBuilder _builder = new StringBuilder();

            int i = 0;

            Dictionary <String, Object> .Enumerator enumerator = FieldValue.GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <String, Object> keyValue = enumerator.Current;

                //Field=@Field1 ,
                _builder.Append(SqlSyntax.SPACE);
                _builder.Append(keyValue.Key);
                _builder.Append(SqlSyntax.EQ);
                _builder.Append(ParemeterHelper.GetParameterString(ParemeterCount));
                if (i != FieldValue.Count - 1)
                {
                    _builder.Append(SqlSyntax.COMMA);
                }
                AddExpressionParameters(keyValue.Value);
                i++;
            }

            return(_builder.ToString());
        }
示例#2
0
        protected override String GetParemetrized()
        {
            // (Field1,Field2,...) VALUES(@Field1,@Field2,@Field3)

            //Values(


            StringBuilder _builder          = new StringBuilder();
            StringBuilder _paremeterBuilder = new StringBuilder();

            _paremeterBuilder.Append(SqlSyntax.VALUES);
            _paremeterBuilder.Append(SqlSyntax.LEFT_PARENTHESE);

            int i = 0;

            //(
            _builder.Append(SqlSyntax.LEFT_PARENTHESE);
            Dictionary <String, Object> .Enumerator enumerator = FieldValue.GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <String, Object> keyValue = enumerator.Current;

                //@Field1,
                _paremeterBuilder.Append(ParemeterHelper.GetParameterString(ParemeterCount));


                //Field
                _builder.Append(keyValue.Key);

                if (i != FieldValue.Count - 1)
                {
                    _paremeterBuilder.Append(SqlSyntax.COMMA);
                    _builder.Append(SqlSyntax.COMMA);
                }
                AddExpressionParameters(keyValue.Value);
                i++;
            }

            _paremeterBuilder.Append(SqlSyntax.RIGHT_PARENTHESE);
            _paremeterBuilder.Append(SqlSyntax.SPACE);

            _builder.Append(SqlSyntax.RIGHT_PARENTHESE);
            _builder.Append(SqlSyntax.SPACE);

            _builder.Append(_paremeterBuilder);
            return(_builder.ToString());
        }