views:

303

answers:

1

Hello, calling a stored procedure as

int pageNumber = 1;
int pageSize = 4;
SubSonic.StoredProcedure sp = SPs.UspListPlants(pageNumber, pageSize);
string result = sp.GetReader();

The sp work fine, but trying

foreach (SubSonic.StoredProcedure.Parameter param in sp.Parameters)
    {
          sb.Append("'" + param.Name + "' = ");
    }

I have zero parameters count.

How to print on log parameter's values of sql stmt executed as :

EXEC UspListPlants(pageNumber = 1, pageSize = 4)

Thank's, regards

Claudio

A: 

Does sp.Parameters actually implement IEnumerable? If not then foreach won't work and you need to call something like a GetEnumerator method on sp.Parameters to be able to iterate over it.

Dave Anderson
Yes, it implement IEnumerable. Sorry, It's not the problem. Thank for reply.