How to call a parameterless stored procedure

Topics: Data Access Application Block, Enterprise Library Core
Feb 3, 2007 at 8:54 PM
I'm trying to call a SQL Server stored procedure that doesn't contain any input parameters (i.e. parameterless stored procedure). I am invoking the method ExecuteDataSet(string storedprocedure, params object[] values). When I call aDatabase.ExecuteDataSet("GetStates", null), it fails. What am I doing wrong ?

Thanks for the help !
Feb 4, 2007 at 12:09 AM
The params keyword makes that parameter optional.

You would instead call it as follows if there are no parameters:

Database.ExecuteDataSet("GetStates");

Regards,

Dave

________________________

David Hayden
Microsoft MVP C#
Feb 4, 2007 at 7:39 PM
Rookie mistake ... thanks again for the help