Monday, June 13, 2016

Did you know that you have to explicitly allow for handing in empty string values when talking to sprocs in C#?

ExecuteReaderCollection<Cat>("HereKittyKitty", new[]
{
   CreateParameter("Name", "")
});

 
 

must become...

ExecuteReaderCollection<Cat>("HereKittyKitty", new[]
{
   CreateParameter("Name", "", whiteSpaceIsNull:false)
});

 
 

If you don't do this you are handing in a null value for Name to HereKittyKitty. This disappoints me.

No comments:

Post a Comment