I'm trying to execute this chunk of code:
public List<CustomerCaseSearch> FindCustomerInfo(string searchCondition)
{
var Query = "SELECT CustomerProfile.CustomerID,CustomerProfile.CustomerName, isNull(k.CustomerSince, '''') as CustomerSince, isNull(k.CustomerStatus,'''') as CustomerStatus," +
"CustomerProfile.CustomerType, CustomerCase.CaseID" +
" FROM CustomerProfile INNER JOIN" +
" CustomerCase ON CustomerProfile.CustomerID = CustomerCase.CustomerID "+ searchCondition;
var customerCaseSearch = _CustomerCaseSearchRepository.ExecuteQueryData<CustomerCaseSearch>(@Query);
List<CustomerCaseSearch> aList = customerCaseSearch.ToList();
return aList;
}
And I keep getting this exception message:
SQLException was unhandled by user code.
Incorrect syntax near 'isNull'
I need to know, what is the correct syntax of using isNull inside an ASP.NET code where I need to put SQL Query?
Please note that I am a newby to professional development so my knowledge is quite low. Kind help anticipated and will be appreciated.
k.