473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Passing UpdateParameters or a Detail View to a stored Procedure

If I try to Update a record with the following code using a stored
procedure I get an error:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:stellentConnectionString %>"
SelectCommand="spWC_Adjusters"
SelectCommandType="StoredProcedure"
InsertCommand="spWC_Adjusters_Insert "
InsertCommandType="StoredProcedure"
UpdateCommand="spWC_Adjusters_Update"
UpdateCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="A"
Name="Adj_Sup" Type="String" />
<asp:ControlParameter ControlID="GridView1"
DefaultValue="%" Name="Adj_Sup_Num" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>

<UpdateParameters>
<asp:Parameter Name="Unit" Type="String" />
<asp:Parameter Name="Sup_Adj_No"
Type="String" />
<asp:Parameter Name="Sup_Adj_Ind"
Type="String" />
<asp:Parameter Name="extension"
Type="String" />
<asp:Parameter Name="User_id" Type="String"
/>
<asp:Parameter Name="Fname" Type="String"
/>
<asp:Parameter Name="Lname" Type="String"
/>
<asp:Parameter Name="Email" Type="String"
/>
<asp:Parameter Name="Designation"
Type="String" />
<asp:Parameter Name="Adj_Type"
Type="String" />
<asp:Parameter Name="Title" Type="String"
/>
<asp:Parameter Name="Queue" Type="String"
/>
<asp:Parameter Name="Sup_No" Type="String"
/>
<asp:Parameter Direction="ReturnValue"
Name="RETURN_VALUE" Type="Int32" />
</UpdateParameters>

I get the error:
Procedure or function spWC_Adjusters_Insert has too many arguments
specified

So then I try to pass in the arguments for the stored procedure, but
then I get another error:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:stellentConnectionString %>"
SelectCommand="spWC_Adjusters"
SelectCommandType="StoredProcedure"
InsertCommand="spWC_Adjusters_Insert "
InsertCommandType="StoredProcedure"
UpdateCommand="spWC_Adjusters_Update @Unit, @Sup_Adj_No"
UpdateCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="A"
Name="Adj_Sup" Type="String" />
<asp:ControlParameter ControlID="GridView1"
DefaultValue="%" Name="Adj_Sup_Num" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>

<UpdateParameters>
<asp:Parameter Name="Unit" Type="String" />
<asp:Parameter Name="Sup_Adj_No"
Type="String" />
<asp:Parameter Name="Sup_Adj_Ind"
Type="String" />
<asp:Parameter Name="extension"
Type="String" />
<asp:Parameter Name="User_id" Type="String"
/>
<asp:Parameter Name="Fname" Type="String"
/>
<asp:Parameter Name="Lname" Type="String"
/>
<asp:Parameter Name="Email" Type="String"
/>
<asp:Parameter Name="Designation"
Type="String" />
<asp:Parameter Name="Adj_Type"
Type="String" />
<asp:Parameter Name="Title" Type="String"
/>
<asp:Parameter Name="Queue" Type="String"
/>
<asp:Parameter Name="Sup_No" Type="String"
/>
<asp:Parameter Direction="ReturnValue"
Name="RETURN_VALUE" Type="Int32" />
</UpdateParameters>
I get the error:
Could not find stored procedure 'spWC_Adjusters_Insert @Unit,
@Sup_Adj_no'.

What gives??????? How can I pass the parameters to the stored
procedure??

Aug 2 '06 #1
1 2615
Something smell like shit ... i have the same problem - something is
wrong with return value parameter on aspx side. When I add returnvalue
parameter at cs side on deleting event then everything is ok.

jk***@charter.net napisal(a):
If I try to Update a record with the following code using a stored
procedure I get an error:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:stellentConnectionString %>"
SelectCommand="spWC_Adjusters"
SelectCommandType="StoredProcedure"
InsertCommand="spWC_Adjusters_Insert "
InsertCommandType="StoredProcedure"
UpdateCommand="spWC_Adjusters_Update"
UpdateCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="A"
Name="Adj_Sup" Type="String" />
<asp:ControlParameter ControlID="GridView1"
DefaultValue="%" Name="Adj_Sup_Num" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>

<UpdateParameters>
<asp:Parameter Name="Unit" Type="String" />
<asp:Parameter Name="Sup_Adj_No"
Type="String" />
<asp:Parameter Name="Sup_Adj_Ind"
Type="String" />
<asp:Parameter Name="extension"
Type="String" />
<asp:Parameter Name="User_id" Type="String"
/>
<asp:Parameter Name="Fname" Type="String"
/>
<asp:Parameter Name="Lname" Type="String"
/>
<asp:Parameter Name="Email" Type="String"
/>
<asp:Parameter Name="Designation"
Type="String" />
<asp:Parameter Name="Adj_Type"
Type="String" />
<asp:Parameter Name="Title" Type="String"
/>
<asp:Parameter Name="Queue" Type="String"
/>
<asp:Parameter Name="Sup_No" Type="String"
/>
<asp:Parameter Direction="ReturnValue"
Name="RETURN_VALUE" Type="Int32" />
</UpdateParameters>

I get the error:
Procedure or function spWC_Adjusters_Insert has too many arguments
specified

So then I try to pass in the arguments for the stored procedure, but
then I get another error:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:stellentConnectionString %>"
SelectCommand="spWC_Adjusters"
SelectCommandType="StoredProcedure"
InsertCommand="spWC_Adjusters_Insert "
InsertCommandType="StoredProcedure"
UpdateCommand="spWC_Adjusters_Update @Unit, @Sup_Adj_No"
UpdateCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="A"
Name="Adj_Sup" Type="String" />
<asp:ControlParameter ControlID="GridView1"
DefaultValue="%" Name="Adj_Sup_Num" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>

<UpdateParameters>
<asp:Parameter Name="Unit" Type="String" />
<asp:Parameter Name="Sup_Adj_No"
Type="String" />
<asp:Parameter Name="Sup_Adj_Ind"
Type="String" />
<asp:Parameter Name="extension"
Type="String" />
<asp:Parameter Name="User_id" Type="String"
/>
<asp:Parameter Name="Fname" Type="String"
/>
<asp:Parameter Name="Lname" Type="String"
/>
<asp:Parameter Name="Email" Type="String"
/>
<asp:Parameter Name="Designation"
Type="String" />
<asp:Parameter Name="Adj_Type"
Type="String" />
<asp:Parameter Name="Title" Type="String"
/>
<asp:Parameter Name="Queue" Type="String"
/>
<asp:Parameter Name="Sup_No" Type="String"
/>
<asp:Parameter Direction="ReturnValue"
Name="RETURN_VALUE" Type="Int32" />
</UpdateParameters>
I get the error:
Could not find stored procedure 'spWC_Adjusters_Insert @Unit,
@Sup_Adj_no'.

What gives??????? How can I pass the parameters to the stored
procedure??
Aug 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MD | last post by:
I am trying to create a dynamic SQL statement to create a view. I have a stored procedure, which based on the parameters passed calls different stored procedures. Each of this sub stored procedure...
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
6
by: dharmadam | last post by:
Is it possible to pass a column name or the order of the column name in the DB2 table table function. For example, I want to update the address of a person by passing one of the address column name...
3
by: jkayne | last post by:
Can someone offer some insight of why parameters outside of those contained in a SqlDataSource <UpdateParameters> section would show up in a profiler trace? I'm using: <UpdateParameters>...
1
by: bill tie | last post by:
I'm exploring Microsoft sample code. This is a master/detail scenario with two SqlDataSources. The master table shows Northwind.Customers data. In the detail table, I can massage a row of data...
3
by: Mike P | last post by:
I must be missing something regarding update parameters. I have tried using <asp:Parameter> to specify my update parameters, and <asp:ControlParameter> when <asp:Parameter> didn't work for a...
4
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx...
0
by: ngoodearl | last post by:
Hi, I have upsized an access db to a sequel 2000 db. The db is used to perform a series of calculations to get a result. The user inputs the required parameters into a form and the data entered is...
7
by: Justin | last post by:
Hi, this code updates a table with the new values with the event RowUpdating of a gridview. Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.