Hi All,
I have a table that has a field, "IsActive," that indicates whether a record has been "deleted" or not.
Currently, I retrieve this info like so:
public DataTable GetContractors(bool IsActive)
{
SqlParameter paramIsActive = new SqlParameter("@IsActive", SqlDbType.Bit);
paramIsActive.Value = IsActive;
DataSet ds = this.SQLDataAccess.ExecSProcReturnDataset(this.AppConfig.ConnectString, "p_selContractors", paramIsActive);
return ds.Tables[0];
}
The code for my DAL and stored procedure is irrelevant, so I'll omit that for now.
Here is my question: this code works fine if I want to return records that ARE active or ARE NOT active... but, how would I modify this to return ALL records (active AND inactive)?
Right now, I have two methods and two stored procs (one with the IsActive parameter and the other without the param), but I know there must be an easier way.
Any suggestions?