Exemplo n.º 1
0
        protected ADODB.Command GenerateCommand(CommandTypeEnum eCmdType, SqlFrag frag)
        {
            ADODB.Command SqlCmd   = new Command();
            string        strQuery = "";

            if (frag.SqlParams.Count < 2040)
            {
                ProcessParameters(SqlCmd, frag);

                // replace our tags
                strQuery = frag.m_strSql.Replace("{", "");
                strQuery = strQuery.Replace("}", "");
            }
            else
            {
                strQuery = frag.Flatten();
            }

            // ensure we have a valid connections
            Ensure();

            // set up the object
            SqlCmd.ActiveConnection = m_pConnection;
            SqlCmd.CommandText      = strQuery;
            SqlCmd.CommandType      = eCmdType;

            return(SqlCmd);
        }
Exemplo n.º 2
0
 public DataSet GetDataSet(SqlFrag frag)
 {
     if (frag.SqlParams.Count < 2040)
     {
         return(GetParamDataSet("{SQL}", frag));
     }
     else
     {
         return(GetParamDataSet(frag.Flatten()));
     }
 }
Exemplo n.º 3
0
 public SqlDataReader GetDataReader(SqlFrag frag)
 {
     if (frag.SqlParams.Count < 2040)
     {
         return(GetParamDataReader("{SQL}", frag));
     }
     else
     {
         return(GetParamDataReader(frag.Flatten()));
     }
 }
Exemplo n.º 4
0
 public int ExecuteSql(SqlFrag frag)
 {
     if (frag.SqlParams.Count < 2040)
     {
         return(ExecuteParamSql("{SQL}", frag));
     }
     else
     {
         return(ExecuteParamSql(frag.Flatten()));
     }
 }