Stored Procedures that return different results to any TableAdapto

G

Guest

I have just recently had an opportunity to start working with VS2005.

I have managed to reproduce an existing ASP.Net 1.1 page almost entirely
using drag n drop designers and object data sources except for one thing.

I need to bind a DataList to the result of a stored procedure that filters,
sorts and union joins to return a result set vastly different to any existing
TableAdaptor in the designer-generated DataSet.

I cannot add a new query to an existing TableAdaptor, as the SP returns a
different schema.. and I cannot add a QueryAdaptor as they only return single
values..

Is it better to create a new TableAdaptor based on this SP to return a
strongly-typed datatable (that is probably only ever used by this one
control)? or add a function to my data layer to execute a DataReader from the
SP (and lose the benefits of strongly-typed DTs)?

any advice appreciated!
 
C

Cowboy \(Gregory A. Beamer\)

Drag the stored procedure onto the DataSet to create the table. It will be
bound to the stored procedure instead of the table. Or, you can adjust hte
current table adapter to work with the stored procedure. Or, you can add
another table adatper. The end result is you want the select to come via the
sproc, not an auto-generated query.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
G

Guest

Dragging the stored proc onto the designer was creating a QueryTableAdaptor
as the first statement in the SP was not a select - hence the confusion.

It seems that if I want to use VS2005 on an existing database, I'll need to
temporarily re-write the stored procs to be in a structure the designer is
expecting, or build the TableAdaptors by hand.

Thanks for the reply!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top