Open GoogleCodeExporter opened 9 years ago
have you walked all the results the proc returns ?
Original comment by sam.saff...@gmail.com
on 26 Jul 2011 at 1:46
I believe the answer to that is yes. I have to call a method to map the
DataReader to a DataSet to retrieve the rowcount as well as maintain
compatibility with my DB class and method signatures, and that method does run
through and reconstruct all the results row by row.
Would that affect the sql timing?
Original comment by andyp...@gmail.com
on 26 Jul 2011 at 1:57
I had a similar issue to this. In had to always create the command from the
connection. I.e.
This did NOT work:
var cmd = new SqlCommand();
cmd.Connection = conn;
This DID work:
var cmd = conn.CreateCommand();
Original comment by mbol...@gmail.com
on 28 Jul 2011 at 6:23
Yep. I'm already using DbCommand cmd = conn.CreateCommand();
Original comment by andyp...@gmail.com
on 28 Jul 2011 at 9:25
@andy, yeah ... if you partially walk results timing is skewed
Can you include a full bit of demo code here so I an repro?
Original comment by sam.saff...@gmail.com
on 29 Jul 2011 at 12:00
Sure. Here's a web project that reproduces the problem exactly. I got it down
to just over 100 lines so it should be pretty easy for you to scan through.
Original comment by andyp...@gmail.com
on 29 Jul 2011 at 9:12
Attachments:
@andy - does it change anything if you set the sqlCommand.commandtype to stored
proc? I noticed it wasn't being set.
Original comment by woodward...@gmail.com
on 5 Aug 2011 at 2:58
The command passed is not actually a stored procedure. It's a sql exec
statement that runs a stored procedure. I'm not explicitly passing in
parameters or anything like that in my db class. It's not ideal, but I just
did it that way and gave up a little bit of safety for a lot of flexibility in
what I could run.
Original comment by andyp...@gmail.com
on 5 Aug 2011 at 3:20
Andy, I have exact same issue, when I'm executing a reader on the a stored
procedure command type. and it is marked as command.CommandType =
CommandType.StoredProcedure;
Original comment by mercury2...@gmail.com
on 5 Jun 2012 at 7:09
Original issue reported on code.google.com by
andyp...@gmail.com
on 25 Jul 2011 at 9:42