Click here to Skip to main content
15,562,816 members
Home / Discussions / C#
   

C#

 
QuestionRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen22-Jan-18 14:54
professionalEddy Vluggen22-Jan-18 14:54 
AnswerRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz22-Jan-18 15:23
mveGerry Schmitz22-Jan-18 15:23 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen22-Jan-18 15:37
professionalEddy Vluggen22-Jan-18 15:37 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz22-Jan-18 17:38
mveGerry Schmitz22-Jan-18 17:38 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen23-Jan-18 1:20
professionalEddy Vluggen23-Jan-18 1:20 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz23-Jan-18 8:37
mveGerry Schmitz23-Jan-18 8:37 
QuestionHow to insert the XML file in SQL Server Pin
Jieha Lee19-Jan-18 5:23
Jieha Lee19-Jan-18 5:23 
AnswerRe: How to insert the XML file in SQL Server Pin
OriginalGriff19-Jan-18 5:58
mvaOriginalGriff19-Jan-18 5:58 
Don't do it like that! Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.

When you concatenate strings, you cause problems because SQL receives commands like:
SQL
SELECT * FROM MyTable WHERE StreetAddress = 'Baker's Wood'
The quote the user added terminates the string as far as SQL is concerned and you get problems. But it could be worse. If I come along and type this instead: "x';DROP TABLE MyTable;--" Then SQL receives a very different command:
SQL
SELECT * FROM MyTable WHERE StreetAddress = 'x';DROP TABLE MyTable;--'
Which SQL sees as three separate commands:
SQL
SELECT * FROM MyTable WHERE StreetAddress = 'x';
A perfectly valid SELECT
SQL
DROP TABLE MyTable;
A perfectly valid "delete the table" command
SQL
--'
And everything else is a comment.
So it does: selects any matching rows, deletes the table from the DB, and ignores anything else.

So ALWAYS use parameterized queries! Or be prepared to restore your DB from backup frequently. You do take backups regularly, don't you?

Chances are, when you fix that throughout your application, the problem you have noticed will vanish at the same time.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

AnswerRe: How to insert the XML file in SQL Server Pin
jschell20-Jan-18 6:54
jschell20-Jan-18 6:54 
GeneralRe: How to insert the XML file in SQL Server Pin
Laxmidhar tatwa technologies23-Jan-18 6:00
Laxmidhar tatwa technologies23-Jan-18 6:00 
GeneralRe: How to insert the XML file in SQL Server Pin
jschell27-Jan-18 6:09
jschell27-Jan-18 6:09 
QuestionCalling a Method from a Form event Pin
ormonds18-Jan-18 15:08
ormonds18-Jan-18 15:08 
AnswerRe: Calling a Method from a Form event Pin
Peter Vegter18-Jan-18 15:35
Peter Vegter18-Jan-18 15:35 
AnswerRe: Calling a Method from a Form event Pin
OriginalGriff18-Jan-18 21:07
mvaOriginalGriff18-Jan-18 21:07 
AnswerRe: Calling a Method from a Form event Pin
ormonds19-Jan-18 18:00
ormonds19-Jan-18 18:00 
GeneralRe: Calling a Method from a Form event Pin
OriginalGriff19-Jan-18 21:34
mvaOriginalGriff19-Jan-18 21:34 
QuestionWhy ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884018-Jan-18 9:18
Member 1228884018-Jan-18 9:18 
AnswerRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Richard MacCutchan18-Jan-18 22:10
mveRichard MacCutchan18-Jan-18 22:10 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884019-Jan-18 8:44
Member 1228884019-Jan-18 8:44 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Richard MacCutchan19-Jan-18 9:01
mveRichard MacCutchan19-Jan-18 9:01 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884019-Jan-18 12:30
Member 1228884019-Jan-18 12:30 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Pete O'Hanlon19-Jan-18 23:22
mvaPete O'Hanlon19-Jan-18 23:22 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884020-Jan-18 7:59
Member 1228884020-Jan-18 7:59 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Pete O'Hanlon20-Jan-18 23:27
mvaPete O'Hanlon20-Jan-18 23:27 
QuestionProject Reference Installed Applications Pin
TheCoolTech18-Jan-18 6:32
TheCoolTech18-Jan-18 6:32 

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.