CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

Procedure or function expects parameter which was not supplied topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2010, 10:53 AM
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
LELE7 is on a distinguished road
| More
Procedure or function expects parameter which was not supplied

My .Net Code
Code:
# connDO.Open();
#                     SqlCommand comm = new SqlCommand("DOrders.dbo.p_Update", connDO);
#                     comm.CommandType = CommandType.StoredProcedure;
#                     daDirectOrders.UpdateCommand = comm;
#  
#     comm.Parameters.Add("@UOrderNumber", SqlDbType.Int, 32, uOrderNumber.ColumnName);
#                     comm.Parameters.Add("@ConfirmationCode", SqlDbType.VarChar, 50, confirmationCode.ColumnName);
#                     comm.Parameters["@ConfirmationCode"].SourceVersion = DataRowVersion.Original;
#                     comm.Parameters.Add("@Carrier", SqlDbType.VarChar, 50, doCarrier.ColumnName);
#                     comm.Parameters.Add("@Tracking", SqlDbType.VarChar, 50, doTracking.ColumnName);
#                     comm.Parameters.Add("@OrderID", SqlDbType.Int, 32, orderID2.ColumnName);
#                     comm.Parameters["@OrderID"].SourceVersion = DataRowVersion.Original;
#                     comm.Parameters.Add("@LineItem", SqlDbType.Int, 32, lineItem.ColumnName);
#                     comm.Parameters["@LineItem"].SourceVersion = DataRowVersion.Original;
#  
#                     daDirectOrders.Update(dataSet);
#                     connDO.Close();
My Stored Procedure:

Code:
#  @UOrderNumber int,
#     @ConfirmationCode varchar(50),
#     @Carrier varchar(50),
#     @Tracking varchar(50),
#     @OrderID int,
#     @LineItem int
#  
# AS
# BEGIN
#  
#     SET NOCOUNT ON;
#  
#     UPDATE Orders 
#         SET UOrderNumber = @UOrderNumber
#         WHERE ConfirmationCode = @ConfirmationCode
#  
#     UPDATE OrdersDetail
#         SET Carrier = @Carrier, Tracking = @Tracking, LastUpdated = GETDATE()
#         WHERE OrderID = @OrderID and LineItem = @LineItem
#  
#  
# END
When I run, I get the following error:

Procedure or function 'p_update' expects parameter '@Carrier' which was not supplied

Why isn't is recognizing my parameter? Also, it does not give a problem with @UOrderNumber and @ConfirmationCode. And when I do Parameters.AddWithValue and pass a string value, it does work. The problem is, that my value has to be a dataColumn from my dataset and addWithValue does not take a dataColumn from what I saw. (correct me if I'm wrong)

Thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

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 Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
function with ... as its parameter? Ming Soon C++ Programming 1 09-02-2010 02:50 AM
Array as function parameter morganJohnson C Programming 0 08-28-2010 03:11 AM
Pass parameter from gridView to Javasript function tinh khau C# Programming 0 08-28-2010 03:11 AM
Execute stored procedure using a string variable sama123 C# Programming 0 06-23-2010 11:39 AM
how to pass the arguments to procedure to close the window vidhya Win32 Programming 0 05-30-2007 05:24 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 02:57 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board