I’m looking at my options here. I would love to know how to write my stored procedures not in the SqlServer but in my app (DB Layer) using SqlHelper?
Can anyone help?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By SqlHelper do you mean the old, deprecated Patterns & Practices class that is now rolled into the Enterprise Library?
The simple answer is you can’t. Stored procedures are, by their definition, stored on the SQL server. If you want to run queries against SQL databases, but don’t want to put the queries in the database as stored procedures then you can use the SqlCommand .NET object which the SqlHelper class wrapped.
You should be aware that once you start writing inline SQL like this you must use SqlParameters parametrised queries to avoid SQL injection.