Run Stored Procedure on MS SQL 2005
-
Hi, could anybody help me? I am trying to run stored procedure on MS SQL 2005. The procedure have one parameter and delete all old records for machine equal to the parameter. I have tried execute it directly in MS SQL Server Management Studio Express and everything was OK. I assign execute rights for the user I used from C# to connect the SQL server but every time I have tried to run the procedure from C# using SQLCommand object I have received the error message in a Output window: A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Where could be the problem?
-
Hi, could anybody help me? I am trying to run stored procedure on MS SQL 2005. The procedure have one parameter and delete all old records for machine equal to the parameter. I have tried execute it directly in MS SQL Server Management Studio Express and everything was OK. I assign execute rights for the user I used from C# to connect the SQL server but every time I have tried to run the procedure from C# using SQLCommand object I have received the error message in a Output window: A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Where could be the problem?
You should put a try-catch block over the code and catch the SqlException specifically - then you can check the inner-exception. that will tell you what is going wrong.
-
Hi, could anybody help me? I am trying to run stored procedure on MS SQL 2005. The procedure have one parameter and delete all old records for machine equal to the parameter. I have tried execute it directly in MS SQL Server Management Studio Express and everything was OK. I assign execute rights for the user I used from C# to connect the SQL server but every time I have tried to run the procedure from C# using SQLCommand object I have received the error message in a Output window: A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Where could be the problem?
Use try/catch block and in catch block see the error message of your exception so that u'll know more about the error.
-
Use try/catch block and in catch block see the error message of your exception so that u'll know more about the error.