Wednesday, September 08, 2010 Register    Login
Instructions

In order to add new threads or reply to existing posts, you have to be logged-in. If you are not registered yet, you need to register first, and then login with your personal credentials.

   

CslaFactory Forums
 
ForumForumSupportSupportCslaFactory CTPCslaFactory CTPProcedure or function XXX expects parameter YYY, which was not suppliedProcedure or function XXX expects parameter YYY, which was not supplied
Previous Previous
 
Next Next
New Post
 8/5/2008 1:45 PM
 
 Modified By Peter Berggreen  on 8/5/2008 1:46:14 PM

I have a simple business object ("Test"), which has a property named "Key".

I would like to be able to get the object using the key, so I added a criteria named "Key".

When I call Test.GetByKey("ABC") I get the following error message when the stored procedure is called:

SqlException (0x80131904): Procedure or function 'mas_GetTest' expects parameter '@TestID', which was not supplied.]

I can get around this problem by adding the following code to Test.ExecuteFetch:

if (criteria.Id == null)
cmd.Parameters.AddWithValue("@TestID", DBNull.Value);
else
cmd.Parameters.AddWithValue("@TestID", criteria.Id);

Will this problem be solved in the next release?

 

New Post
 8/5/2008 6:04 PM
 

Hi Peter,

I will have a look at it, but I think I already fixed it some time ago.

Marcel

New Post
 8/6/2008 1:53 PM
 

That would be perfect.

I *really* look forward to the next release.

Peter

New Post
 8/18/2008 10:57 AM
 

The reverse case is also a problem:

When I call Test.GetTest(TestId) I get the same error message.

The problem can be solved by checking for a null value for the Key parameter:

if (criteria.Key == null)
cmd.Parameters.AddWithValue("@Key", DBNull.Value);
else
cmd.Parameters.AddWithValue("@Key", criteria.Key);

Hopefully your solution also takes care of this situation.

 

New Post
 8/18/2008 11:37 AM
 

Thanks again, Peter. I will check that either.
Marcel

Previous Previous
 
Next Next
ForumForumSupportSupportCslaFactory CTPCslaFactory CTPProcedure or function XXX expects parameter YYY, which was not suppliedProcedure or function XXX expects parameter YYY, which was not supplied

   

UsersOnline
Membership Membership:
Latest New User Latest: weikol
Past 24 Hours Past 24 Hours: 1
Prev. 24 Hours Prev. 24 Hours: 1
User Count Overall: 1381

People Online People Online:
Visitors Visitors: 10
Members Members: 0
Total Total: 10

Online Now Online Now: