Click here to Skip to main content
15,896,153 members
Home / Discussions / C#
   

C#

 
GeneralRe: Looping Through Windows Forms Instances Pin
XanderSon15-Jun-04 14:00
XanderSon15-Jun-04 14:00 
Generalc#-Configuration file Pin
Member 115090115-Jun-04 10:46
Member 115090115-Jun-04 10:46 
GeneralRe: c#-Configuration file Pin
Heath Stewart15-Jun-04 11:18
protectorHeath Stewart15-Jun-04 11:18 
GeneralCombobox displaying listview items Pin
mikeyb2515-Jun-04 9:17
mikeyb2515-Jun-04 9:17 
GeneralSQL Escape Sequences Pin
Kannan Kalyanaraman15-Jun-04 8:26
Kannan Kalyanaraman15-Jun-04 8:26 
GeneralRe: SQL Escape Sequences Pin
Werdna15-Jun-04 8:36
Werdna15-Jun-04 8:36 
GeneralRe: SQL Escape Sequences Pin
Alvaro Mendez15-Jun-04 8:50
Alvaro Mendez15-Jun-04 8:50 
GeneralRe: SQL Escape Sequences Pin
Heath Stewart15-Jun-04 8:59
protectorHeath Stewart15-Jun-04 8:59 
The easiest way to handle this is used parameterized SQL expressions in ADO.NET. For example, if you use a SqlCommand, use the SqlParameters in the SqlCommand.Parameters (the property documentation includes an example). Constructing the SQL string without the parameters is straight forward enough since you have total control over it. Using parameters for the values (for an INSERT, UPDATE, DELETE, etc.) will eliminate the common problems (trying to inject another statement) while taking care of escaping quotes for you.

This is by far a better and safer alternative. The days of concatenating strings to form a SQL expression are (or at least should be) over.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: SQL Escape Sequences Pin
Kannan Kalyanaraman15-Jun-04 9:17
Kannan Kalyanaraman15-Jun-04 9:17 
GeneralRe: SQL Escape Sequences Pin
Heath Stewart15-Jun-04 9:19
protectorHeath Stewart15-Jun-04 9:19 
GeneralRe: SQL Escape Sequences Pin
vplus24-Oct-09 2:13
vplus24-Oct-09 2:13 
GeneralappDomain and dynamic loading in .net CF Pin
ppp00115-Jun-04 8:18
ppp00115-Jun-04 8:18 
GeneralDropDownList Manipulation. Pin
stan2815-Jun-04 7:24
stan2815-Jun-04 7:24 
GeneralRe: DropDownList Manipulation. Pin
Alvaro Mendez15-Jun-04 8:41
Alvaro Mendez15-Jun-04 8:41 
GeneralDLL and Copy Local Pin
goldoche15-Jun-04 7:08
goldoche15-Jun-04 7:08 
GeneralRe: DLL and Copy Local Pin
Alvaro Mendez15-Jun-04 7:52
Alvaro Mendez15-Jun-04 7:52 
GeneralRe: DLL and Copy Local Pin
Heath Stewart15-Jun-04 9:09
protectorHeath Stewart15-Jun-04 9:09 
GeneralRe: DLL and Copy Local Pin
goldoche15-Jun-04 10:50
goldoche15-Jun-04 10:50 
GeneralRe: DLL and Copy Local Pin
Heath Stewart15-Jun-04 11:13
protectorHeath Stewart15-Jun-04 11:13 
GeneralYU Pin
Anonymous15-Jun-04 6:55
Anonymous15-Jun-04 6:55 
GeneralWhen to create your own DLL Pin
SantoG15-Jun-04 6:19
SantoG15-Jun-04 6:19 
GeneralRe: When to create your own DLL Pin
Alvaro Mendez15-Jun-04 7:59
Alvaro Mendez15-Jun-04 7:59 
GeneralRe: When to create your own DLL Pin
Heath Stewart15-Jun-04 9:07
protectorHeath Stewart15-Jun-04 9:07 
GeneralRe: When to create your own DLL Pin
Alvaro Mendez15-Jun-04 10:47
Alvaro Mendez15-Jun-04 10:47 
GeneralRe: When to create your own DLL Pin
Heath Stewart15-Jun-04 11:11
protectorHeath Stewart15-Jun-04 11:11 

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.