Last post Sep 14, 2015 11:26 AM by Sandeep Apsingekar
Sep 12, 2015 11:57 AM|Sandeep Apsingekar|LINK
The application is running, but I came across another error which says that the stored procedure is not found. Following is the error:
System.Data.SqlClient.SqlException: Could not find stored procedure for the solution
I'm new to asp.net programming. And I'm facing some issues with stored procedures. The thing is I'm able to access the database, and I see that I have all the stored procedures available in the data base. Can anyone help me out with this issue, any avice
or help would be appreciated. Let me know if I have to specify any other information. The following is the error message:
Sep 12, 2015 12:08 PM|Rion Williams|LINK
Assuming that you are targeting the proper database, which sounds like that is working as expected, you should be able to create a command that points to the name of the stored procedure and indicate it is in fact a stored procedure :
using(var connection = new SqlConnection("Your Connection String"))
using(var command = new SqlCommand("StoreProcedureName",connection))
// Open your connection
// Indicate it is a stored procedure
// Add your parameters here
// Execute here using either command.ExecuteNonQuery(), command.ExecuteReader() or command.ExecuteScalar()
You need to ensure that the name you are referencing matches your stored procedure exactly to ensure it finds it.
Sep 12, 2015 12:36 PM|Sandeep Apsingekar|LINK
I want to know why do we get the stored procedures not found error. Even If we have set of stored procedures available in the database. I'm able to run the application and the database is connected properly, the thing is I'm able to log in to my applications
but, when I try to run some stored procedures through my application, that doesn't run. I appreciate the help from this forum so far but want to know why do we actually get this error.
Sep 12, 2015 02:01 PM|wim sturkenboom|LINK
Case sensitivity? E.g
Sep 12, 2015 02:11 PM|kalusinghrao07|LINK
Just i get your problems regarding store procedures are not working properly while you are using applications. First of all you should confirm to check your database connectivity and also check your connection string is in right format. You can check your
connection string format as given below.
<add name="MyConnectionString" connectionString="Data Source=KALUSINGH;Initial Catalog=Movies; User ID=sa;Password=Nothing@123;" providerName="System.Data.SqlClient"/>
One more thing is you should now how to execute your store procedures (SP) in c#.net or vb.net.
dt = dbhelp.ExecuteDataTable("EXEC GetDetail '" + MovieID+ "'," + CategoryID+ ",'" + Year+ "'," + UserID+ "")
You can see above code have executed SP with their required arguments. where dbhelp is instance of DataBaseHelper class.
I hope it code will help you. If you have any problems after it you can email me for get more suggestions.
Sep 13, 2015 11:51 AM|Sandeep Apsingekar|LINK
Thank you very much for the response. The thing is I'm able to access the database, if connectivity was the issue it won't even allow me to access my asp.net application. But, I'm able to run all other pages, except the pages that are linked to the stored
Sep 13, 2015 11:53 AM|Sandeep Apsingekar|LINK
Thank you for the response. I would once cross check the case sensitivity. But, I'm able to execute the stored procedures in sql server management studio, I think there is some other issue.
Sep 13, 2015 12:35 PM|PatriceSc|LINK
The message is really "Could not find stored procedure for the solution"? I would expect "Could not find stored procedure 'z'". What is the client side code that triggers that?
In short, it seems the SP is really not found: the name is really wrong or maybe you are not calling this against the right db or the stored procedure is not even exposed to the account you are using.
Sep 14, 2015 11:26 AM|Sandeep Apsingekar|LINK
Thank you very much for giving all the possible solutions. I got through the issue. It was my fault, I had a typo error in the stored procedure. After looking at all your answers, I went through the code and got the error. Once again Thank you very much.