Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in Refresh Fields functionality?

2 views
Skip to first unread message

Rohan Cragg

unread,
Jun 11, 2004, 11:59:59 AM6/11/04
to
Whilst writing a Custom Data Processing Extension I seem to have
discovered some strange behaviour.

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.

Robert Bruckner [MSFT]

unread,
Jun 11, 2004, 2:48:15 PM6/11/04
to
What happens if your custom data extension is called with
ExecuteReader(CommandBehavior.SchemaOnly)?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_clr_dataproc_1w6b.asp

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...

Rohan Cragg

unread,
Jun 15, 2004, 7:08:12 AM6/15/04
to
OK, that's great and makes alot of sense. Clearly my implementation
needs the parameters before it can return any information because it
needs either the filepath for a serialised DataSet, or the raw XML
text, otherwise it cannot return any information on fields.

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.

0 new messages