﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Stored Procedure Problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 07:02:16 GMT</lastBuildDate><ttl>20</ttl><item><title>Stored Procedure Problem</title><link>http://forum.strataframe.net/FindPost26457.aspx</link><description>I have a Stored Proc that works fine from SSMS. In general this is what the Stored Proc looks like:&lt;br&gt;
1. Deletes data in Table A.&lt;br&gt;
2. Inserts data in Table A with an Insert ... Select ...&lt;br&gt;
3. Deletes data in Table B.&lt;br&gt;
4. With a Parameter it Inserts Data in Table B with an Insert ... Select ...&lt;br&gt;
&lt;br&gt;
The Data in Table B is from Table A using a Group By. The BO is based on Table B and remains empty when I try to fill it with the following commands:&lt;br&gt;
                Dim cmd As New SqlCommand("sp_gborderbyavegoonegotwo")&lt;br&gt;
                cmd.CommandType = CommandType.StoredProcedure&lt;br&gt;
                cmd.Parameters.Add("@rodeoid", SqlDbType.Int).Value = nrod&lt;br&gt;
                Me.FillDataTable(cmd)&lt;br&gt;
&lt;br&gt;
nrod is defined as an integer and has the correct value. Of course I don't know if a stored proc can have multiple statements but since it worked in SSMS I thought it would work with a BO and I tried to find the info on the forum but could not. Thank you for any advise you can give me. If you need more info please let me know. TIA&lt;br&gt;
&lt;br&gt;</description><pubDate>Sun, 14 Mar 2010 21:00:49 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Stored Procedure Problem</title><link>http://forum.strataframe.net/FindPost26471.aspx</link><description>Glad you got it figured out :)</description><pubDate>Sun, 14 Mar 2010 21:00:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Stored Procedure Problem</title><link>http://forum.strataframe.net/FindPost26470.aspx</link><description>I ended up putting the Select in the sproc and use the filldatatable(cmd). Works great. Thanks for the input.</description><pubDate>Sun, 14 Mar 2010 20:19:23 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item><item><title>RE: Stored Procedure Problem</title><link>http://forum.strataframe.net/FindPost26465.aspx</link><description>I would really have to take a look at ths SPROC to give you a more definite answer.&amp;nbsp; It looks like you are calling the scalar first which would return a single value then calling a fill which would return a result set.&amp;nbsp; This would ultimately be 2 result sets when coming from a single SPROC.&amp;nbsp; My rule of thumb is the fewer trips that you make to the server the better off....so if you could do this in a single SPROC, you would be better off.&amp;nbsp; But like I said, I would have to have a slightly better grasp of what you are trying to do.&amp;nbsp; Your logic will most likely work just fine for the long term, but if you could consolidate this into a single trip, that never hurts! :)</description><pubDate>Sun, 14 Mar 2010 19:59:05 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Stored Procedure Problem</title><link>http://forum.strataframe.net/FindPost26458.aspx</link><description>I solved my problem but I am not sure I did it correctly so if someone could let me know what the correct way to do this is or if there is a better way.&lt;br&gt;
&lt;br&gt;
I used the following:&lt;br&gt;
                Me.ExecuteScalar(cmd)&lt;br&gt;
                Me.FillDataTable("Select * from TimesPointsTempAverage")&lt;br&gt;
 &lt;br&gt;
TIA.</description><pubDate>Fri, 12 Mar 2010 14:31:02 GMT</pubDate><dc:creator>Terry Bottorff</dc:creator></item></channel></rss>