Best way to prevent SQL injection using Javascript or C #?

I am currently writing an application that uses ajax on the front panel and ASP.NET (C #) on the back panel.

A small part of the application makes an AJAX call in the internal code (to retrieve records from an SQL database)

How can I prevent SQL injection from JScript?

I know that it is generally unsafe to check with javascript because javascript can be disabled, but since it is an AJAX call, so if the user has disabled JavaScript, AJAX will never work.

What is the best way to test or speed up input?

Like Add_Slashes () in PHP?

thank

Daniel

+3
source share
7

, SQL.

+11

SQL- , , .

, Javascript, , Javascript .

AJAX: JavaScript; Javascript, , .

, , .

+14

, Parametirized Query Adhoc SQL

+2

, , .

Ajax- , , SQL-.

- , , .

, LINQ to SQL Entities , , SQL Injection.

, sql , .

LINQ, ( !) .

+1

Javascript , Javascript .

Javascript , , - , . ( , - , , , ' , ), , , .

AJAX 30 , , . . Javascript , ( ).

, , , , . "" SQL-, , , . , . , ; , , "", , , . , (, , , , -, , , , , ).

, Javascript , .

, , , .

. SQL ( , ' , ), , , # Parameters ADO.NET, SQL ( ).

0

All Articles