StoredProcedure sp = new StoredProcedure("my_stored_proc"); sp.Command.AddParameter("param1", DbType.String, "value1"); sp.Command.AddParameter("param2", DbType.Int32, 123);
DataSet ds = sp.ExecuteDataSet();
sp.Command.AddParameter("out_param", DbType.Int32, null, ParameterDirection.Output); sp.Execute(); int result = Convert.ToInt32(sp.Command.Parameters["out_param"].Value);In these examples, SubSonic's StoredProcedure class is used to create a new stored procedure object, set input parameters, execute the stored procedure, and retrieve output parameters. SubSonic is a package library that provides a comprehensive set of tools for interacting with databases in .NET applications. It can be installed using NuGet or downloaded from the SubSonic website.