How can i write stored procedures in my application using SqlHelper?
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?
Ca开发者_JAVA百科n anyone help?
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.
精彩评论