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
|
We use LightSpeed v3.1.(Mindscape.LightSpeed.dll version is 3.1.2673.17134) on production environment. I encountered a curious SQL Exception recently on production, but I couldn't reproduce this exception on local environment..
Below code(Uow.SaveChanges) raised the exception. ----------------------------------------------------
var signupSessionData = Uow.FindById<SignupSessionData>(id);
if (signupSessionData.data != data) { signupSessionData.data = data; Uow.SaveChanges(); // raise SQL Exception!! }
---------------------------------------------------- [Exception detail] System.Data.SqlClient.SqlException (0x80131904): Must declare the scalar variable "@p1". ----------------------------------------------------
Could you have any ideas why this exception occured ?
Thanks, nabehiro |
|
|
There's no obvious reason from your example why this should happen. We might be able to make a guess if we saw the model, but even then I'm not optimistic unless you can identify what's different between the production and local scenarios (and thereby obtain a repro case). If you can repeat the error in production (but not locally) then one thing you could do is hook up a logger (LightSpeedContext.Logger, LightSpeedContext.VerboseLogging) and capture the generated SQL. That might give us some sort of clue as to what the mystery @p1 is doing... |
|