Following my debug trace information I can see that ExecuteReader is
being called twice whenever the Refresh Fields button is pressed, first
time round the parameters are being passed as empty strings and an
ArgumentException is thrown when trying to load a DataSet (which the
Report Designer seems to just ignore). I can see via a debug trace that
ExecuteReader then gets called a second time, this time passing the
parameters as I have entered them.
More detail is available in my blog post:
http://www.sharepointblogs.com/rcragg/archive/2004/06/11/540.aspx
Rohan.
If you actually execute the query when ExecuteReader(SchemaOnly) is called
then the implementation is incorrect. For SchemaOnly execution, no parameter
values are passed in because no query should be executed - just the columns
should be returned.
When Refreshing Fields, the report designer first tries to determine the
fields based on ExecuteReader(SchemaOnly) because this should not affect any
database state (and it is cheaper). If SchemaOnly fails, then report
designer tries to actually execute the query and determine the fields based
on the returned dataset. In order to execute the query it has to pass in
parameter values.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rohan Cragg" <rohan...@hotmail.com> wrote in message
news:cacktv$b...@odah37.prod.google.com...
I guess I can just immediately throw an exception if
ExecuteReader(SchemaOnly) is called, unless you can suggest a more
elegant solution?
Thanks again, Rohan.