Click here to Skip to main content
15,891,654 members
Home / Discussions / C#
   

C#

 
GeneralRe: WPF C# Messagebox Result Issue Pin
Derek Kennard22-Jan-18 6:37
professionalDerek Kennard22-Jan-18 6:37 
GeneralRe: WPF C# Messagebox Result Issue Pin
phil.o22-Jan-18 6:40
professionalphil.o22-Jan-18 6:40 
GeneralRe: WPF C# Messagebox Result Issue Pin
Derek Kennard22-Jan-18 7:43
professionalDerek Kennard22-Jan-18 7:43 
GeneralRe: WPF C# Messagebox Result Issue Pin
Derek Kennard23-Jan-18 8:05
professionalDerek Kennard23-Jan-18 8:05 
GeneralRe: WPF C# Messagebox Result Issue Pin
phil.o23-Jan-18 11:53
professionalphil.o23-Jan-18 11:53 
QuestionCoding Moveable Elements for Games or Whatever Pin
Member 1358827720-Jan-18 2:03
Member 1358827720-Jan-18 2:03 
SuggestionRe: Coding Moveable Elements for Games or Whatever Pin
Richard MacCutchan20-Jan-18 3:01
mveRichard MacCutchan20-Jan-18 3:01 
AnswerRe: Coding Moveable Elements for Games or Whatever Pin
BillWoodruff20-Jan-18 5:17
professionalBillWoodruff20-Jan-18 5:17 
AnswerRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen21-Jan-18 3:10
professionalEddy Vluggen21-Jan-18 3:10 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Nathan Minier22-Jan-18 1:21
professionalNathan Minier22-Jan-18 1:21 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Member 1358827722-Jan-18 5:47
Member 1358827722-Jan-18 5:47 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Nathan Minier22-Jan-18 5:58
professionalNathan Minier22-Jan-18 5:58 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen22-Jan-18 8:42
professionalEddy Vluggen22-Jan-18 8:42 
AnswerRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz22-Jan-18 12:03
mveGerry Schmitz22-Jan-18 12:03 
QuestionRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen22-Jan-18 13:54
professionalEddy Vluggen22-Jan-18 13:54 
AnswerRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz22-Jan-18 14:23
mveGerry Schmitz22-Jan-18 14:23 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen22-Jan-18 14:37
professionalEddy Vluggen22-Jan-18 14:37 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz22-Jan-18 16:38
mveGerry Schmitz22-Jan-18 16:38 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Eddy Vluggen23-Jan-18 0:20
professionalEddy Vluggen23-Jan-18 0:20 
GeneralRe: Coding Moveable Elements for Games or Whatever Pin
Gerry Schmitz23-Jan-18 7:37
mveGerry Schmitz23-Jan-18 7:37 
QuestionHow to insert the XML file in SQL Server Pin
Jieha Lee19-Jan-18 4:23
Jieha Lee19-Jan-18 4:23 
AnswerRe: How to insert the XML file in SQL Server Pin
OriginalGriff19-Jan-18 4:58
mveOriginalGriff19-Jan-18 4: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 5:54
jschell20-Jan-18 5:54 
GeneralRe: How to insert the XML file in SQL Server Pin
Laxmidhar tatwa technologies23-Jan-18 5:00
Laxmidhar tatwa technologies23-Jan-18 5:00 
GeneralRe: How to insert the XML file in SQL Server Pin
jschell27-Jan-18 5:09
jschell27-Jan-18 5:09 

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.