Search   

Thursday, September 09, 2010

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  Stored Procedur...
 Stored Procedure
 
 8/30/2007 2:58:58 PM
michael
5 posts


Stored Procedure
I would like to load a list of objects from the database via a stored procedure (i.e. called Rohstoffe).

NDO.NDOQuery q = new NDOQuery(Pm, "Rohstoffe", false, Query.Language.Sql);
return q.Execute();

This works well if the SP has no parameters. But I can't figure out how to provide parameters to the stored procedure.

Thanks,
Michael
 8/30/2007 4:45:57 PM
Mirko
109 posts
5th


Re: Stored Procedure

Hi Michael,

as far as I know the parameters for Stored Procedures are transferred the same way as parameters for queries. So try to just add your parameters to the query:

NDOQuery<...>q = new NDOQuery<...>(...);
q.Parameters.Add(myFirstParameter);
q.Parameters.Add(mySecondParameter);

The order of the parameters must match the order of the parameters as defined in the parameter list of the SP.

This solution applies only to Sql Server.

Best Regards:
Mirko

 

 8/31/2007 9:25:11 AM
michael
5 posts


Re: Stored Procedure
Hi Mirko,

this was also my first idea. But it doesn't work. I'm actually using MS Sql Server 2005.

An SqlExeption stating that the required Parameter '...' is expected but not provided is thrown.

Greetings,
Michael
 9/4/2007 7:36:12 AM
Mirko
109 posts
5th


Re: Stored Procedure
 Modified By Mirko  on 9/4/2007 8:36:50 AM)

Hi Michael,

due to illness I'm currently not able to code and provide an example by myself. I'm very sorry for this.

NDO automatically assigns names to the parameters. For Sql Server the names are @p0, @p1 .... @pn. The parameter names of your SP must match these names.

Hope, this helps... sorry again.

Best Regards
Mirko

  NDO-Forum postings in english please, if possible.  Developing with NDO  Stored Procedur...
  SearchSearch  Forum HomeForum Home