public static int ExecuteNonQuery(String procedure, params SqlParameter[] args)
{
if (args == null) throw new ArgumentNullException("args");
else
return ExecuteNonQuery(procedure, new SqlParameter[] { });
}
Why getting recursive function and throwing StackOverFlow Exception when calling this above method.(while the argument contains 5 values)
Don't confuse an empty array with a null array. You're calling the same method again with an empty array, but the only check you have to cease this function is to check for a null array, and throw an exception. You need something like:
if (args.length == 0) {
// bail out somehow
}
(after your null check, to prevent NPEs)
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