HighTechTalks DotNet Forums  

String manipulations with SQL

CSharp microsoft.public.dotnet.languages.csharp


Discuss String manipulations with SQL in the CSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
news.microsoft.com
 
Posts: n/a

Default String manipulations with SQL - 05-03-2005 , 01:18 PM






What is the best way to avoid string manipulations with SQL?

I have edit box control where database is opened for attacks through SQL
commands.

Something like this:
selectString = "SELECT FIRSTNAME, LASTNAME FROM xxxTable WHERE
FIRSTNAME='"+txtTextBox1.Text"'";

Furthermore I would like to avoid of using some characters like ;:,. etc.

If you know for some example I appreciate it. Thanks in advance...



Reply With Quote
  #2  
Old   
Michael C#
 
Posts: n/a

Default Re: String manipulations with SQL - 05-03-2005 , 01:21 PM






Use Parameterized Queries to avoid SQL Injection attacks.

"news.microsoft.com" <ablyplus (AT) yahoo (DOT) com> wrote

Quote:
What is the best way to avoid string manipulations with SQL?

I have edit box control where database is opened for attacks through SQL
commands.

Something like this:
selectString = "SELECT FIRSTNAME, LASTNAME FROM xxxTable WHERE
FIRSTNAME='"+txtTextBox1.Text"'";

Furthermore I would like to avoid of using some characters like ;:,. etc.

If you know for some example I appreciate it. Thanks in advance...




Reply With Quote
  #3  
Old   
PFD
 
Posts: n/a

Default Re: String manipulations with SQL - 05-03-2005 , 01:27 PM



Here's a great article to help avoid SQL attacks:

http://msdn.microsoft.com/msdnmag/issues/04/09/SQLInjection/default.aspx

Good luck!
PFD

news.microsoft.com wrote:
Quote:
What is the best way to avoid string manipulations with SQL?

I have edit box control where database is opened for attacks through
SQL
commands.

Something like this:
selectString = "SELECT FIRSTNAME, LASTNAME FROM xxxTable WHERE
FIRSTNAME='"+txtTextBox1.Text"'";

Furthermore I would like to avoid of using some characters like ;:,.
etc.

If you know for some example I appreciate it. Thanks in advance...


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.