473,770 Members | 4,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing UpdateParameter s 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:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:stellentConn ectionString %>"
SelectCommand=" spWC_Adjusters"
SelectCommandTy pe="StoredProce dure"
InsertCommand=" spWC_Adjusters_ Insert "
InsertCommandTy pe="StoredProce dure"
UpdateCommand=" spWC_Adjusters_ Update"
UpdateCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:Paramete r DefaultValue="A "
Name="Adj_Sup" Type="String" />
<asp:ControlPar ameter ControlID="Grid View1"
DefaultValue="% " Name="Adj_Sup_N um" PropertyName="S electedValue"
Type="String" />
</SelectParameter s>

<UpdateParamete rs>
<asp:Paramete r Name="Unit" Type="String" />
<asp:Paramete r Name="Sup_Adj_N o"
Type="String" />
<asp:Paramete r Name="Sup_Adj_I nd"
Type="String" />
<asp:Paramete r Name="extension "
Type="String" />
<asp:Paramete r Name="User_id" Type="String"
/>
<asp:Paramete r Name="Fname" Type="String"
/>
<asp:Paramete r Name="Lname" Type="String"
/>
<asp:Paramete r Name="Email" Type="String"
/>
<asp:Paramete r Name="Designati on"
Type="String" />
<asp:Paramete r Name="Adj_Type"
Type="String" />
<asp:Paramete r Name="Title" Type="String"
/>
<asp:Paramete r Name="Queue" Type="String"
/>
<asp:Paramete r Name="Sup_No" Type="String"
/>
<asp:Paramete r Direction="Retu rnValue"
Name="RETURN_VA LUE" Type="Int32" />
</UpdateParameter s>

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:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:stellentConn ectionString %>"
SelectCommand=" spWC_Adjusters"
SelectCommandTy pe="StoredProce dure"
InsertCommand=" spWC_Adjusters_ Insert "
InsertCommandTy pe="StoredProce dure"
UpdateCommand=" spWC_Adjusters_ Update @Unit, @Sup_Adj_No"
UpdateCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:Paramete r DefaultValue="A "
Name="Adj_Sup" Type="String" />
<asp:ControlPar ameter ControlID="Grid View1"
DefaultValue="% " Name="Adj_Sup_N um" PropertyName="S electedValue"
Type="String" />
</SelectParameter s>

<UpdateParamete rs>
<asp:Paramete r Name="Unit" Type="String" />
<asp:Paramete r Name="Sup_Adj_N o"
Type="String" />
<asp:Paramete r Name="Sup_Adj_I nd"
Type="String" />
<asp:Paramete r Name="extension "
Type="String" />
<asp:Paramete r Name="User_id" Type="String"
/>
<asp:Paramete r Name="Fname" Type="String"
/>
<asp:Paramete r Name="Lname" Type="String"
/>
<asp:Paramete r Name="Email" Type="String"
/>
<asp:Paramete r Name="Designati on"
Type="String" />
<asp:Paramete r Name="Adj_Type"
Type="String" />
<asp:Paramete r Name="Title" Type="String"
/>
<asp:Paramete r Name="Queue" Type="String"
/>
<asp:Paramete r Name="Sup_No" Type="String"
/>
<asp:Paramete r Direction="Retu rnValue"
Name="RETURN_VA LUE" Type="Int32" />
</UpdateParameter s>
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 2652
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.n et napisal(a):
If I try to Update a record with the following code using a stored
procedure I get an error:

<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:stellentConn ectionString %>"
SelectCommand=" spWC_Adjusters"
SelectCommandTy pe="StoredProce dure"
InsertCommand=" spWC_Adjusters_ Insert "
InsertCommandTy pe="StoredProce dure"
UpdateCommand=" spWC_Adjusters_ Update"
UpdateCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:Paramete r DefaultValue="A "
Name="Adj_Sup" Type="String" />
<asp:ControlPar ameter ControlID="Grid View1"
DefaultValue="% " Name="Adj_Sup_N um" PropertyName="S electedValue"
Type="String" />
</SelectParameter s>

<UpdateParamete rs>
<asp:Paramete r Name="Unit" Type="String" />
<asp:Paramete r Name="Sup_Adj_N o"
Type="String" />
<asp:Paramete r Name="Sup_Adj_I nd"
Type="String" />
<asp:Paramete r Name="extension "
Type="String" />
<asp:Paramete r Name="User_id" Type="String"
/>
<asp:Paramete r Name="Fname" Type="String"
/>
<asp:Paramete r Name="Lname" Type="String"
/>
<asp:Paramete r Name="Email" Type="String"
/>
<asp:Paramete r Name="Designati on"
Type="String" />
<asp:Paramete r Name="Adj_Type"
Type="String" />
<asp:Paramete r Name="Title" Type="String"
/>
<asp:Paramete r Name="Queue" Type="String"
/>
<asp:Paramete r Name="Sup_No" Type="String"
/>
<asp:Paramete r Direction="Retu rnValue"
Name="RETURN_VA LUE" Type="Int32" />
</UpdateParameter s>

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:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:stellentConn ectionString %>"
SelectCommand=" spWC_Adjusters"
SelectCommandTy pe="StoredProce dure"
InsertCommand=" spWC_Adjusters_ Insert "
InsertCommandTy pe="StoredProce dure"
UpdateCommand=" spWC_Adjusters_ Update @Unit, @Sup_Adj_No"
UpdateCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:Paramete r DefaultValue="A "
Name="Adj_Sup" Type="String" />
<asp:ControlPar ameter ControlID="Grid View1"
DefaultValue="% " Name="Adj_Sup_N um" PropertyName="S electedValue"
Type="String" />
</SelectParameter s>

<UpdateParamete rs>
<asp:Paramete r Name="Unit" Type="String" />
<asp:Paramete r Name="Sup_Adj_N o"
Type="String" />
<asp:Paramete r Name="Sup_Adj_I nd"
Type="String" />
<asp:Paramete r Name="extension "
Type="String" />
<asp:Paramete r Name="User_id" Type="String"
/>
<asp:Paramete r Name="Fname" Type="String"
/>
<asp:Paramete r Name="Lname" Type="String"
/>
<asp:Paramete r Name="Email" Type="String"
/>
<asp:Paramete r Name="Designati on"
Type="String" />
<asp:Paramete r Name="Adj_Type"
Type="String" />
<asp:Paramete r Name="Title" Type="String"
/>
<asp:Paramete r Name="Queue" Type="String"
/>
<asp:Paramete r Name="Sup_No" Type="String"
/>
<asp:Paramete r Direction="Retu rnValue"
Name="RETURN_VA LUE" Type="Int32" />
</UpdateParameter s>
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
8102
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 creates a string of custom SQL statement and returns this string back to the main stored procedure. This SQL statements work fine on there own. The SQL returned from the sub stored procedure are returned fine. The datatype of the variable that...
10
5637
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 create a single View and specify also in this View the WHERE clause that is common in these stored procedures, I will have the new stored procecures changed to be like:
6
6297
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 like ZIP CODE or ADDRESS LINE. I will call the function with three parameter--UpdateAddress(5,zip_code,person_id) where 5 indicates ZIP_CODE is the fifth column in the table. If 4 is passed, it indicates the address line is to be updated. ...
3
8966
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> <asp:Parameter Name="MerchID" Type="Int32" /> <asp:Parameter Name="Merchant" Type="String" /> <asp:Parameter Name="ModifiedBy" Type="String" /> </UpdateParameters>
1
1428
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 selected from the master table. In the SqlDataSource code that handles the "detail" part, I see a mile-long <UpdateParameters> list: <UpdateParameters> <asp:Parameter Name="CompanyName" Type="String" /> <asp:Parameter Name="ContactName"...
3
8761
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 particular parameter. Here is my code : < asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
4
2761
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 to a stored procedure on the details2.aspx page. I can successfully pass the values from the listbox control to a
0
4737
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 used in the calculations. At the moment we have a stored procedure that performs the calculations. This contains 22 queries. The remaining queries are stored as views (over 30). The problem we have is that one parameter is set in a view outside...
7
5068
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 System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Dim vlgn As Int16
0
9602
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10237
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.