This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi,
I'm just trying out Lightspeed and got it to work just
fine. Except for stored procedures, it returns no data
at all.
I've used the SP within Management Studio & By using Ado.net.
No problems there. And since I've used Lightspeed in other
scenarios and it worked there, I must be doing something
wrong with calling the SP.
Can you see any faults within the code?
This is what the code looks like (Using VB9):
Using uow As MontagePlanUnitOfWork = Repository.Context.CreateUnitOfWork()
Dim teamLeaders As IList(Of GetAllNamesForGroupResult) = uow.GetAllNamesForGroup("'TeamLeader'")
[snip]
End Using
In the model I have the following:
GetAllNamesForGroup (string soktGruppNamn1), Select Procedure
GetAllNamesForGroupResult, Entity
Thanks!
|
|
|
This might be an issue with the stored procedure not matching LightSpeed's expected conventions. Does the procedure return the identity in the first column? Is the first column named "Id" (or the identity column name of the result type)? In LightSpeed 2.2 RTM both of these had to be true (in the nightlies, the Id column can appear anywhere, but it still has to have the right name). Another possibility (though I would expect this to cause an error rather than no result) is that the parameter name is wrong. Can you check that the parameter name being set up in the GetAllNamesForGroup generated code matches the name in the procedure definition? (The reason I'm suspicious of this is that the soktGruppNamn1 parameter seems to have a numeric suffix -- is that 1 suffix correct?) You might also want to turn on logging (uow.Context.Logger = New TraceLogger(), uow.Context.VerboseLogging = True) to verify that the expected parameter values are being sent and that LightSpeed is marking them up with the correct data types. Finally, as a sanity check, and since you're getting no results rather than an error, could you double-check that the data in the database is such that there would definitely be values for "TeamLeader"? It's just possible that we're returning no values because the sproc is returning no values... *grin* If none of this helps, could you provide us with the CREATE PROCEDURE statement for the stored procedure, and the generated code for GetAllNamesForGroup and GetAllNamesForGroupResult? Thanks! (By the way, you mention Management Studio so I assume you're using SQL Server; let us know if you're using something different.) |
|