Hello Explain me please how MS SQL Server Stored Procedures should be called: via QueryForObject or Update methods?
I'm creating object in runtime, fill its properties and want to save it to the database. To save I should call stored procedure that will inserts object and returns object ID as output parameters. This procedure could raise error if something goes wrong. If I call this procedure (and procedure raises an error) via SqlMapper.Insert or QueryForObject methods it fails with exception "Cannot widen from target type to primitive type" or something like that. I couldn't see "native" exception :( If I call this procedure via SqlMapper.Update statement - all works fine and I could see error from the procedure. In the iBATIS tests SP are called via QueryForObject method. Why? This method will create unnecessary object, isn't it? -- Good bye. ___________________________________________________________________________ This communication is confidential and may be legally privileged. If you believe you are not an intended recipient, please inform the sender, delete the e-mail and do not copy, print or use it or disclose it to others. You can inform the sender by replying to this e-mail or by telephone (+380 44 4906080).