コード例 #1
0
 /// <summary>
 /// Use this contructor inorder to execute connected command
 /// </summary>
 /// <param name="sql"></param>
 /// <param name="sqlType"></param>
 public CommandVirtualization(string sql, SqlType sqlType)
 {
     Parameters = new ParamsVirtulization();
     m_sql      = sql;
     m_sqlType  = sqlType;
     NewColumns = new ColumnVirtualization();
 }
コード例 #2
0
 /// <summary>
 /// Use this contructor inorder to execute disconnected command which need only the query without insert, delete and update.
 /// </summary>
 /// <param name="sqlQuery"></param>
 /// <param name="sqlInsert"></param>
 /// <param name="sqlUpdate"></param>
 /// <param name="sqlDelete"></param>
 public CommandVirtualization(string sqlQuery)
 {
     NewColumns = new ColumnVirtualization();
     Parameters = new ParamsVirtulization();
     m_disconnectedSqls.sqlQuery  = sqlQuery;
     m_disconnectedSqls.sqlInsert = null;
     m_disconnectedSqls.sqlUpdate = null;
     m_disconnectedSqls.sqlDelete = null;
 }
コード例 #3
0
        public void SetParameters(ParamsVirtulization parameters, DbCommand sqlCommand)
        {
            int         i;
            string      typeName = null;
            DbParameter dbParam  = GetNewParameter();;

            for (i = 0; i < parameters.Count; i++)
            {
                if (parameters[i].typeName != null)
                {
                    typeName = parameters[i].typeName;
                }
                else
                {
                    Type t = parameters[i].value.GetType();
                    typeName = t.Name;
                }
                AddParameter(typeName, parameters[i].name, parameters[i].value, sqlCommand, dbParam);
            }
        }