Null means the value is unknown.
'' means that there is a value, and that it's an empty string.
If your database allows nulls for the CustomerName and PartyCode fields, you would need to check for them in your query. One option would be this:
select * from dbo.M_CustomerMasterDetails
where
CustomerMasterId= 281 and (
isnull(CustomerName, '') = ''
or isnull(PartyCode, '') = '')
As an aside, there are syntax errors in your queries above. That might account for some of your issues.