How to protect against SQL injections

We have just suffered a SQL injection into our sql 2008 database running our .net websites.

The intruders planted a script in all our content item that would have displayed a page of links offset so as not to be visible to users, but picked up by search engines.

I am shocked by how they have managed to retrieve the names of tables and fields.

How can we determine where they got in, and how can we protect ourselves from such threats in future?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

gaurav05Connect With a Mentor Commented:

check this one,

let us know for  more information.
Ramesh Babu VavillaConnect With a Mentor Commented:
this url helps you with sample and good explanation
millsap_singerConnect With a Mentor Commented:
Use parameterized queries for your insert/update statements.  
nhmediaAuthor Commented:
In the end we came up with our own solution based on an http handler to prevent undesirable requests being processed.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.