Hi
I have a stored procedure that returns two recordsets which i call using GetReader. I iterate the first, call IDataReader.NextResult(), then iterate the second.
I assign values to output parameters in the sp, but when i check the values after finishing with my reader, my output parameters are null. Looks like a bug. I don't want to use a select since i don't like fudges. Some snippets...
...
sp.Command.AddParameter("@SelectedTabID", selectedTabID, DbType.Int32);
sp.Command.AddParameter("@CurrentTabID", 0, DbType.Int32, ParameterDirection.Output);
sp.Command.AddParameter("@TypeID", 0, DbType.Int32, ParameterDirection.Output);
(note doing it this way or using AddOutputParameter() yields same results)
...
using(IDataReader reader = sp.GetReader())
{
while (reader.Read()) {...}
if (reader.NextResult()) {while (reader.Read()) {...}}
}
...
int one = (int)sp.OutputValues[0]; //null expected an int
int two = (int)sp.OutputValues[1]; //null expected an int
Looking forward to some gems of wisdom :)