Click here to Skip to main content
15,895,423 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: frames in asp.net Pin
Abhishek Sur6-Sep-09 10:37
professionalAbhishek Sur6-Sep-09 10:37 
Questiondatalist bound to a multiline textbox problem! [modified] Pin
Seraph_summer6-Sep-09 3:52
Seraph_summer6-Sep-09 3:52 
AnswerRe: datalist bound to a multiline textbox problem! Pin
Abhijit Jana6-Sep-09 4:12
professionalAbhijit Jana6-Sep-09 4:12 
GeneralRe: datalist bound to a multiline textbox problem! Pin
Seraph_summer6-Sep-09 4:28
Seraph_summer6-Sep-09 4:28 
QuestionRegular Expression Validator...... Pin
greendragons6-Sep-09 1:41
greendragons6-Sep-09 1:41 
AnswerRe: Regular Expression Validator...... Pin
Abhijit Jana6-Sep-09 2:20
professionalAbhijit Jana6-Sep-09 2:20 
AnswerRe: Regular Expression Validator...... Pin
N a v a n e e t h6-Sep-09 3:20
N a v a n e e t h6-Sep-09 3:20 
AnswerRe: Regular Expression Validator...... Pin
Abhishek Sur6-Sep-09 9:59
professionalAbhishek Sur6-Sep-09 9:59 
Hey.. Why do you need Regular Expression validators to prevent from SQL injection.... ??
I think it is good to have data validation in the client side... For Example :
"\d+" will only take numeric values...
You may use like
"^(Insert|Update|Delete|Select)([A-Z][a-z]+)+" [It might be better if I take time]
to ensure that the user dont enter DML statements in input.

But why do you need to do this?? I think only a simple thing solves the entire problem. Say you have a TextBox called txtName in the page, you write :

using(SqlCommand cmd = new SqlCommand("Update name = @pName where id='23'",con)) //assuming con = SqlConnection
{ 
    SqlParameter param = new SqlParameter("@pName", SqlDbType.NVarchar);
    param.value = txtName.Text;// This line will automatically eliminates any SQL injection data.
    cmd.Parameters.add(param);
    cmd.ExecuteNonQuery();
}


Isnt it simple enough???
Cool | :cool:

Abhishek Sur

My Latest Articles
Create CLR objects in SQL Server 2005
C# Uncommon Keywords
Read/Write Excel using OleDB

Don't forget to click "Good Answer" if you like to.

Questionabout the use of validator control in asp.net Pin
Seraph_summer5-Sep-09 23:30
Seraph_summer5-Sep-09 23:30 
AnswerRe: about the use of validator control in asp.net Pin
Abhijit Jana5-Sep-09 23:57
professionalAbhijit Jana5-Sep-09 23:57 
AnswerRe: about the use of validator control in asp.net Pin
en.Mahdi6-Sep-09 0:20
en.Mahdi6-Sep-09 0:20 
GeneralRe: about the use of validator control in asp.net Pin
Seraph_summer6-Sep-09 2:00
Seraph_summer6-Sep-09 2:00 
QuestionProblem in Connecting to Sqlserver 2000 Pin
en.Mahdi5-Sep-09 19:52
en.Mahdi5-Sep-09 19:52 
AnswerRe: Problem in Connecting to Sqlserver 2000 Pin
Abhijit Jana5-Sep-09 21:37
professionalAbhijit Jana5-Sep-09 21:37 
AnswerRe: Problem in Connecting to Sqlserver 2000 Pin
en.Mahdi6-Sep-09 0:10
en.Mahdi6-Sep-09 0:10 
AnswerRe: Problem in Connecting to Sqlserver 2000 Pin
Abhishek Sur5-Sep-09 23:55
professionalAbhishek Sur5-Sep-09 23:55 
AnswerRe: Problem in Connecting to Sqlserver 2000 Pin
en.Mahdi6-Sep-09 0:13
en.Mahdi6-Sep-09 0:13 
GeneralRe: Problem in Connecting to Sqlserver 2000 Pin
Abhishek Sur6-Sep-09 1:13
professionalAbhishek Sur6-Sep-09 1:13 
AnswerRe: Problem in Connecting to Sqlserver 2000 Pin
Vimalsoft(Pty) Ltd5-Sep-09 23:58
professionalVimalsoft(Pty) Ltd5-Sep-09 23:58 
AnswerRe: Problem in Connecting to Sqlserver 2000 Pin
en.Mahdi6-Sep-09 0:17
en.Mahdi6-Sep-09 0:17 
GeneralRe: Problem in Connecting to Sqlserver 2000 Pin
Vimalsoft(Pty) Ltd6-Sep-09 20:02
professionalVimalsoft(Pty) Ltd6-Sep-09 20:02 
Questionwebservice Pin
farokhian5-Sep-09 10:21
farokhian5-Sep-09 10:21 
AnswerRe: webservice Pin
Christian Graus5-Sep-09 10:41
protectorChristian Graus5-Sep-09 10:41 
GeneralRe: webservice Pin
Abhishek Sur5-Sep-09 10:50
professionalAbhishek Sur5-Sep-09 10:50 
GeneralRe: webservice Pin
farokhian5-Sep-09 10:51
farokhian5-Sep-09 10:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.