I am binding a result set from a stored procedure to a grid. The stored proc and the number and type of parameters are known during runtime only. I know how to do this in plain ADO.NET. How do I do it using Petapoco? I only used PetaPoco with known classes and proc at design time.
Asked
Active
Viewed 264 times
1 Answers
0
PetaPoco doesn't really provide anything fancy in this area. It pretty much just comes down to building a SQL string and calling it with one of the standard Database methods (Execute, Fetch, etc). You will want to use PetaPoco's SQL builder though (PetaPoco.Sql.Builder); the Append
method will take care of parameter parsing.
Rather than provide a full example I'll point you to this answer, which covers it nicely.

Community
- 1
- 1

Todd Menier
- 37,557
- 17
- 150
- 173