Considering this example:
MyParameters.Name = "Paul";
MyParameters.Nickname = String.Empty;
ExecuteStoredProcedure(MyStoredProcedure, MyParameters);
When my stored procedure executes it will run something like this?
MyStoredProcedure 'Paul',''
So, my question is: C# String.Empty
is equal to Database ''
?
PS.: I'm using SQL Server
Yes, an empty string is sent as an empty string. See, the values are translated and sent as expected. For example, if you needed to send null
then you'd set Nickname
like this:
MyParameters.Nickname = null;
Your code is also equivalent to:
MyParameters.Nickname = "";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With