PC Review


Reply
Thread Tools Rate Thread

Dataset designer and complex Stored procedure

 
 
Gerard
Guest
Posts: n/a
 
      27th Aug 2007
I have many complex SQL Server 2000 stored procedures, using cursors, temp
tables... They all finally return a resultset that could be a join on
several user and temp tables.

Now, when I try to drag some of them on a dataset in VS 2005, the designer
will create a QueriesTableAdapter for a query that returns no data or a
scalar value, which is not what my procedure does.

The only way I found to create the working typed dataset (apart from
manually designing it) is to create a fake SP that returns the correct data
(creating the table in the SP) and then reconfigure the TableAdapter to
connect it to the correct SP. This is a lot of work if I have lots of
procedures, and it isn't easy to maintain if procedures change.

Is there a better way to do it? Where can I find a documentation that would
tell me what are the creterias for the drag and drop operation to work on a
Dataset?

Gerard.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWFuaXNoIEJhZm5h?=
Guest
Posts: n/a
 
      27th Aug 2007
Hi,
See "Hooking up the Other Stored Procedures" in below link:
http://www.theserverside.net/tt/arti...ataSetDesigner
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



"Gerard" wrote:

> I have many complex SQL Server 2000 stored procedures, using cursors, temp
> tables... They all finally return a resultset that could be a join on
> several user and temp tables.
>
> Now, when I try to drag some of them on a dataset in VS 2005, the designer
> will create a QueriesTableAdapter for a query that returns no data or a
> scalar value, which is not what my procedure does.
>
> The only way I found to create the working typed dataset (apart from
> manually designing it) is to create a fake SP that returns the correct data
> (creating the table in the SP) and then reconfigure the TableAdapter to
> connect it to the correct SP. This is a lot of work if I have lots of
> procedures, and it isn't easy to maintain if procedures change.
>
> Is there a better way to do it? Where can I find a documentation that would
> tell me what are the creterias for the drag and drop operation to work on a
> Dataset?
>
> Gerard.
>

 
Reply With Quote
 
Gerard
Guest
Posts: n/a
 
      28th Aug 2007
It's an interesting article, but it doesn't help me solve my problem.

I cannot have the Dataset designer create a DataTable from an existing
stored procedure:

- If I just drag-drop the SP onto the Dataset designer, it will create a
Query in the QueriesTableAdapter that returns no data.
- If I use the TableAdapter Wizard to create a TableAdapter, I can select
the SP, but the last screen shows an error:

Generated SELECT statement. Invalid object name '#TEMP'.

#TEMP is the name of one of the temp tables created by the SP.

"Manish Bafna" <(E-Mail Removed)> a écrit dans le
message de news:9BEB8124-481B-41A7-BDAB-(E-Mail Removed)...
> Hi,
> See "Hooking up the Other Stored Procedures" in below link:
> http://www.theserverside.net/tt/arti...ataSetDesigner
> --
> Hope this helps.
> Thanks and Regards.
> Manish Bafna.
> MCP and MCTS.
>
>
>
> "Gerard" wrote:
>
>> I have many complex SQL Server 2000 stored procedures, using cursors,
>> temp
>> tables... They all finally return a resultset that could be a join on
>> several user and temp tables.
>>
>> Now, when I try to drag some of them on a dataset in VS 2005, the
>> designer
>> will create a QueriesTableAdapter for a query that returns no data or a
>> scalar value, which is not what my procedure does.
>>
>> The only way I found to create the working typed dataset (apart from
>> manually designing it) is to create a fake SP that returns the correct
>> data
>> (creating the table in the SP) and then reconfigure the TableAdapter to
>> connect it to the correct SP. This is a lot of work if I have lots of
>> procedures, and it isn't easy to maintain if procedures change.
>>
>> Is there a better way to do it? Where can I find a documentation that
>> would
>> tell me what are the creterias for the drag and drop operation to work on
>> a
>> Dataset?
>>
>> Gerard.
>>


 
Reply With Quote
 
Gerard
Guest
Posts: n/a
 
      28th Aug 2007
To be more precise, my main problem is to have the Dataset designer generate
the DataTable.

The only solutions I have found are:

1- Build it by hand in the designer.
2- Create a table that has the same columns as the result set returned by
the SP, drag that and the change the TableAdapter to use the SP.

Both are not very satisfactory and not easy to maintain.

"Manish Bafna" <(E-Mail Removed)> a écrit dans le
message de news:9BEB8124-481B-41A7-BDAB-(E-Mail Removed)...
> Hi,
> See "Hooking up the Other Stored Procedures" in below link:
> http://www.theserverside.net/tt/arti...ataSetDesigner
> --
> Hope this helps.
> Thanks and Regards.
> Manish Bafna.
> MCP and MCTS.
>
>
>
> "Gerard" wrote:
>
>> I have many complex SQL Server 2000 stored procedures, using cursors,
>> temp
>> tables... They all finally return a resultset that could be a join on
>> several user and temp tables.
>>
>> Now, when I try to drag some of them on a dataset in VS 2005, the
>> designer
>> will create a QueriesTableAdapter for a query that returns no data or a
>> scalar value, which is not what my procedure does.
>>
>> The only way I found to create the working typed dataset (apart from
>> manually designing it) is to create a fake SP that returns the correct
>> data
>> (creating the table in the SP) and then reconfigure the TableAdapter to
>> connect it to the correct SP. This is a lot of work if I have lots of
>> procedures, and it isn't easy to maintain if procedures change.
>>
>> Is there a better way to do it? Where can I find a documentation that
>> would
>> tell me what are the creterias for the drag and drop operation to work on
>> a
>> Dataset?
>>
>> Gerard.
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Cannot create Stored Procedure in designer Robert Morley Microsoft Access ADP SQL Server 2 21st Dec 2006 06:58 PM
Stored procedure w/multiple SPs - can I use DataSet Designer? Eddie Microsoft ADO .NET 2 31st Jul 2006 10:53 PM
Stored Procedures in DataSet Designer?? eappell Microsoft C# .NET 0 31st Jul 2006 07:08 PM
Stored Procedure Columns not returned in designer =?Utf-8?B?SG93YXJkIENhcnI=?= Microsoft Dot NET 0 30th Jan 2006 11:49 AM
Returning complex data relationships from a stored procedure. Peter Rilling Microsoft C# .NET 1 1st Jun 2005 04:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:58 AM.