This question is really a follow up to an answer on another thread but is off topic to that original question so I am asking it in a new thread.
Why does CodeRush warn me of an Unused Declaration in code?
The question can stand on its own so the link to the original question is just a reference for the curious.
My question is simply this? Will the Save() Method ever return a false or is it always going to return true?
public bool Save()
{
bool success = false;
using (DataAccess.ExecuteDataTable("[dbo].[udp_Customers_ups]",
DataAccess.Parameter(CustomerIdColumn, CustomerId),
DataAccess.Parameter(CodeColumn, Code),
DataAccess.Parameter(CompanyColumn, Company),
DataAccess.Parameter(CommentsColumn, Comments),
DataAccess.Parameter(ContactColumn, Contact),
DataAccess.Parameter(StreetColumn, Street),
DataAccess.Parameter(CityColumn, City),
DataAccess.Parameter(StateColumn, State),
DataAccess.Parameter(ZipcodeColumn, Zipcode),
DataAccess.Parameter(PhoneColumn, Phone),
DataAccess.Parameter(IsNewColumn, IsNew),
DataAccess.Parameter(IsDeletedColumn, IsDeleted),
DataAccess.Parameter(LastUpdatedColumn, LastUpdated),
DataAccess.Parameter(UpdatedByColumn, UpdatedBy)))
{
success = true;
}
return success;
}
I have tried to force a situation where the using wont work but every time I do I get a different error. So I am thinking that this method is always going true because anything that is going to cause it to fail is going to surface on the data layer and will never make it back here to return a false.