Error when calling a stored procedure - 06-07-2004 , 09:41 AM
I get the SqlException
"A severe error occurred on the current command. The results, if any, should be discarded."
when I call the stored procedure sp_addmergepublication
This is my code
SqlCommand cmd = new SqlCommand()
cmd.Connection = conn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "[sp_addmergepublication]"
Unless the error, the publication is still created
Calling the same stored procedure in the SQL Query Analyser doesnot give this error
Why do I get this error in my application
Does anyone know a solution
Re: Error when calling a stored procedure - 06-07-2004 , 10:10 AM
Try giving a dbtype to the parameter you are using .. see if that still
gives you this error. Make sure that the DBtype matches whats in the
Also, by any chance are you on framework 1.0? Can you update to 1.1?
Another approach -> Try installing hotfix 815495
- Sahil Malik
You can reach me thru my blog at -
"Marco" <marco.broenink (AT) ict (DOT) nl> wrote
RE: Error when calling a stored procedure - 06-07-2004 , 01:21 PM
I think you need to have placeholder in the command text for the parameters
cmd.CommandText = "[sp_addmergepublication(@publication)]"
cmd.CommandText = "[sp_addmergepublication(?)]"
RE: Error when calling a stored procedure - 06-08-2004 , 05:31 AM
Thanks for the replies
Unfortunately these suggestions do not solve the problem
Actually I am calling the sp_addmergepublication in a trigger. This trigger is fired because of an INSERT executed by an ADO.NET SQLCommand
So the problem is not the way how I call the sp_addmergepublication, but that this SP is called as result of the execution of an ADO.NET SQLCommand
I hope someone knows a solution
|Thread Tools||Search this Thread|