/// <summary> /// Removes parameter from the Parameter Collection /// </summary> /// <param name="parameter">Parameter to be removed</param> public void Remove(DBParameter parameter) { _parameterCollection.Remove(parameter); }
internal IDataAdapter GetDataAdapter(string sqlCommand, IDbConnection connection, DBParameter param, CommandType commandType) { IDataAdapter adapter = null; IDbCommand command = (new CommandBuilder()).GetCommand(sqlCommand, connection, param, commandType); switch (Configuration.DBProvider.Trim().ToUpper()) { case Comon.SQL_SERVER_DB_PROVIDER: adapter = new SqlDataAdapter((SqlCommand)command); break; case Comon.MY_SQL_DB_PROVIDER: // adapter = new MySqlDataAdapter((MySqlCommand)command); break; case Comon.ORACLE_DB_PROVIDER: // adapter = new OracleDataAdapter((OracleCommand)command); break; case Comon.EXCESS_DB_PROVIDER: adapter = new OleDbDataAdapter((OleDbCommand)command); break; case Comon.OLE_DB_PROVIDER: adapter = new OleDbDataAdapter((OleDbCommand)command); break; case Comon.ODBC_DB_PROVIDER: adapter = new OdbcDataAdapter((OdbcCommand)command); break; } return(adapter); }
/// <summary> /// Executes the Sql Command and returns the DataReader. /// </summary> /// <param name="commandText">Sql Command</param> /// <param name="con">Database Connection object (DBHelper.GetConnObject() may be used)</param> /// <param name="param">Parameter to be associated with the Sql Command.</param> /// <returns>DataReader</returns> public IDataReader ExecuteDataReader(string commandText, IDbConnection con, DBParameter param) { return(ExecuteDataReader(commandText, con, param, CommandType.Text)); }
/// <summary> /// Adds a DBParameter to the ParameterCollection /// </summary> /// <param name="parameter">Parameter to be added</param> public void Add(DBParameter parameter) { _parameterCollection.Add(parameter); }
/// <summary> /// Executes the Sql Command and return resultset in the form of DataTable. /// </summary> /// <param name="commandText">Sql Command</param> /// <param name="param">Parameter to be associated with the Command.</param> /// <returns>Result in the form of DataTable</returns> public DataTable ExecuteDataTable(string commandText, DBParameter param) { return(ExecuteDataTable(commandText, string.Empty, param, CommandType.Text)); }
/// <summary> /// Executes the Sql Command or Stored Procedure and return resultset in the form of DataTable. /// </summary> /// <param name="commandText">Sql Command or Stored Procedure Name</param> /// <param name="tableName">Table name</param> /// <param name="param">Parameter to be associated with the Command.</param> /// <param name="commandType">Type of command (i.e. Sql Command/ Stored Procedure name/ Table Direct)</param> /// <returns>Result in the form of DataTable</returns> public DataTable ExecuteDataTable(string commandText, string tableName, DBParameter param, CommandType commandType) { return(ExecuteDataTable(commandText, tableName, param, commandType)); }
/// <summary> /// Executes the Sql Command and return resultset in the form of DataSet. /// </summary> /// <param name="commandText">Sql Command </param> /// <param name="param">Parameter to be associated with the command</param> /// <returns>Result in the form of DataSet</returns> public DataSet ExecuteDataSet(string commandText, DBParameter param) { return(ExecuteDataSet(commandText, param, CommandType.Text)); }
/// <summary> /// Executes Sql Command and returns number of rows effected. /// </summary> /// <param name="commandText">Sql Command</param> /// <param name="param">Parameter to be associated with the command</param> /// <returns>Number of rows effected.</returns> public int ExecuteNonQuery(string commandText, DBParameter param) { return(ExecuteNonQuery(commandText, param, CommandType.Text)); }
/// <summary> /// Executes the Sql Command and returns result. /// </summary> /// <param name="commandText">Sql Command</param> /// <param name="param">Parameter to be associated</param> /// <returns>A single value. (First row's first cell value, if more than one row and column is returned.)</returns> public object ExecuteScalar(string commandText, DBParameter param) { return(ExecuteScalar(commandText, param, CommandType.Text)); }