コード例 #1
0
        public DataSet ExecuteDataset(CommandType commandType, string commandText, Param commandParameters, DataSet ds, string tableName)
        {
            ComCommand cmd = new ComCommand();

            PrepareCommand(cmd, commandType, commandText, commandParameters);
            ComDataAdapter da = new ComDataAdapter(cmd);

            if (Object.Equals(tableName, null) || (tableName.Length < 1))
            {
                da.Fill(ds);
            }
            else
            {
                da.Fill(ds, tableName);
            }
            cmd.Parameters.Clear();
            return(ds);
        }
コード例 #2
0
        public DataView ExecuteDataView(CommandType commandType, string commandText, Param commandParameters)
        {
            DataSet    ds  = new DataSet();
            ComCommand cmd = new ComCommand();

            PrepareCommand(cmd, commandType, commandText, commandParameters);

            ComDataAdapter da = new ComDataAdapter(cmd);

            da.Fill(ds, "MyTableName");

            cmd.Parameters.Clear();
            return(ds.Tables["MyTableName"].DefaultView);
        }