Click here to Skip to main content
15,564,310 members
Home / Discussions / C#
   

C#

 
AnswerRe: iTextSharp to Append QRCode to an Existing PDF File Pin
Richard Deeming23-Nov-22 23:00
mveRichard Deeming23-Nov-22 23:00 
QuestionTriangles count in Graph Pin
Member 1177893019-Nov-22 16:20
Member 1177893019-Nov-22 16:20 
AnswerRe: Triangles count in Graph Pin
Dave Kreskowiak19-Nov-22 19:03
mveDave Kreskowiak19-Nov-22 19:03 
AnswerRe: Triangles count in Graph Pin
OriginalGriff19-Nov-22 21:20
mvaOriginalGriff19-Nov-22 21:20 
AnswerRe: Triangles count in Graph Pin
Gerry Schmitz20-Nov-22 6:13
mveGerry Schmitz20-Nov-22 6:13 
QuestionDynamic table insert issue with dates Pin
Vijay Bhaskar Oct202217-Nov-22 7:32
Vijay Bhaskar Oct202217-Nov-22 7:32 
AnswerRe: Dynamic table insert issue with dates Pin
Slacker00717-Nov-22 7:46
professionalSlacker00717-Nov-22 7:46 
AnswerRe: Dynamic table insert issue with dates Pin
OriginalGriff17-Nov-22 9:40
mvaOriginalGriff17-Nov-22 9:40 
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. Always use Parameterized 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?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

AnswerRe: Dynamic table insert issue with dates Pin
Richard Deeming17-Nov-22 22:37
mveRichard Deeming17-Nov-22 22:37 
QuestionMicrosoft.Practices.Composite.Presentation.Events Pin
Kevin Marois16-Nov-22 13:14
professionalKevin Marois16-Nov-22 13:14 
AnswerRe: Microsoft.Practices.Composite.Presentation.Events Pin
Dave Kreskowiak16-Nov-22 13:49
mveDave Kreskowiak16-Nov-22 13:49 
AnswerRe: Microsoft.Practices.Composite.Presentation.Events Pin
Richard Deeming16-Nov-22 22:31
mveRichard Deeming16-Nov-22 22:31 
QuestionI'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Rakos4613-Nov-22 11:46
Rakos4613-Nov-22 11:46 
AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Mycroft Holmes13-Nov-22 12:06
professionalMycroft Holmes13-Nov-22 12:06 
AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
OriginalGriff13-Nov-22 19:53
mvaOriginalGriff13-Nov-22 19:53 
AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Calin Negru14-Nov-22 4:28
Calin Negru14-Nov-22 4:28 
AnswerRe: I'm getting error code CS1001. And I'm not sure how to diagnose the problem. Pin
Victor Nijegorodov14-Nov-22 4:40
Victor Nijegorodov14-Nov-22 4:40 
QuestionMy Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil9-Nov-22 18:45
Radheya Patil9-Nov-22 18:45 
AnswerRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
OriginalGriff9-Nov-22 19:48
mvaOriginalGriff9-Nov-22 19:48 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil10-Nov-22 2:05
Radheya Patil10-Nov-22 2:05 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Richard Deeming10-Nov-22 2:24
mveRichard Deeming10-Nov-22 2:24 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil10-Nov-22 2:42
Radheya Patil10-Nov-22 2:42 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Richard Deeming10-Nov-22 3:00
mveRichard Deeming10-Nov-22 3:00 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
Radheya Patil10-Nov-22 17:37
Radheya Patil10-Nov-22 17:37 
GeneralRe: My Code gets stuck at MessageBox.Show() after pressing OK it does not move further. Pin
jsc4210-Nov-22 6:08
professionaljsc4210-Nov-22 6:08 

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.