Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDatabase accessDatabase access
Previous
 
Next
New Post
11/26/2010 7:09 AM
 
Sebastian Leupold wrote:
Let me jump in here to provide some advice for Aristotelis: there are best practices for safety and performance reasons, you never know in you business logic, where input parameters may come from, even if not atm, in a future extension it might be passed from UI without proper check and you will be vulnerable to SQL injection. The proper alternatives are either put the SQL code into stored procedures or use Linq2SQL, where security is provided on compile and run time.

 
You don't have to put your SQL code into stored procedures to get the benefit of SQL injection protection. You only need to make sure that you use parameters in your SQL like this: "SELECT * FROM MyTable WHERE ID=@ID" and then declare the @ID parameter on the command object. Using parameters will also ensure that SQL server is able to optimize and cache the query plan for later. Most DNN stored procedures I have seen are just thin wrappers around some SQL INSERT, UPDATE, DELETE and SELECT. They don't add much value beyond making the task of changing the schema a time consuming pain.  One use-case where a stored procedure makes sense is when you insert into a table with an identity field. Not uncommon in the DNN world. Using a stored proc to insert, select and return the new identity value saves one roundtrip to the database. That would be worth the extra time and effort. Wrapping tens of different queries in thin stored proc wrappers. Not worth the effort in my view.

 
New Post
11/26/2010 7:14 AM
 
Aristotelis

It looks ok now, but the best validation is installation and test 

Sergey
 
New Post
11/26/2010 7:18 AM
 
I would like to thank everyone who responded to this thread.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDatabase accessDatabase access


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out