Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
QuestionTo me this error msg is very cryptic! I am using VS2017 with MS Excel 2007 Pin
Greg Gonzales8-Jul-19 11:43
Greg Gonzales8-Jul-19 11:43 
AnswerRe: To me this error msg is very cryptic! I am using VS2017 with MS Excel 2007 Pin
Dave Kreskowiak8-Jul-19 11:54
mveDave Kreskowiak8-Jul-19 11:54 
GeneralRe: To me this error msg is very cryptic! I am using VS2017 with MS Excel 2007 Pin
Greg Gonzales8-Jul-19 17:09
Greg Gonzales8-Jul-19 17:09 
Questionhelp Pin
Member 145235257-Jul-19 13:40
Member 145235257-Jul-19 13:40 
AnswerRe: help Pin
Mycroft Holmes7-Jul-19 17:48
professionalMycroft Holmes7-Jul-19 17:48 
GeneralRe: help Pin
OriginalGriff7-Jul-19 18:46
mveOriginalGriff7-Jul-19 18:46 
GeneralRe: help Pin
Member 145235257-Jul-19 21:49
Member 145235257-Jul-19 21:49 
GeneralRe: help Pin
OriginalGriff7-Jul-19 22:09
mveOriginalGriff7-Jul-19 22:09 
Quote:
read up on sql injection attacks as you are inviting someone to destroy your database.

What that means is this: 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?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: help Pin
Member 145235257-Jul-19 21:50
Member 145235257-Jul-19 21:50 
GeneralRe: help Pin
OriginalGriff7-Jul-19 22:14
mveOriginalGriff7-Jul-19 22:14 
GeneralRe: help Pin
CHill608-Jul-19 2:17
mveCHill608-Jul-19 2:17 
GeneralRe: help Pin
Mycroft Holmes8-Jul-19 11:26
professionalMycroft Holmes8-Jul-19 11:26 
QuestionZKTeco with C# Pin
Member 142231355-Jul-19 20:01
Member 142231355-Jul-19 20:01 
AnswerRe: ZKTeco with C# Pin
OriginalGriff5-Jul-19 20:18
mveOriginalGriff5-Jul-19 20:18 
GeneralRe: ZKTeco with C# Pin
BillWoodruff6-Jul-19 20:53
professionalBillWoodruff6-Jul-19 20:53 
AnswerRe: ZKTeco with C# Pin
BillWoodruff6-Jul-19 20:50
professionalBillWoodruff6-Jul-19 20:50 
QuestionC# LINQ JOIN: Getting out of memory exception Pin
Mou_kol5-Jul-19 10:03
Mou_kol5-Jul-19 10:03 
AnswerRe: C# LINQ JOIN: Getting out of memory exception Pin
Mycroft Holmes5-Jul-19 13:28
professionalMycroft Holmes5-Jul-19 13:28 
GeneralRe: C# LINQ JOIN: Getting out of memory exception Pin
Mou_kol8-Jul-19 5:53
Mou_kol8-Jul-19 5:53 
GeneralRe: C# LINQ JOIN: Getting out of memory exception Pin
Dave Kreskowiak8-Jul-19 6:27
mveDave Kreskowiak8-Jul-19 6:27 
GeneralRe: C# LINQ JOIN: Getting out of memory exception Pin
Eddy Vluggen8-Jul-19 8:22
professionalEddy Vluggen8-Jul-19 8:22 
GeneralRe: C# LINQ JOIN: Getting out of memory exception Pin
Gerry Schmitz8-Jul-19 10:50
mveGerry Schmitz8-Jul-19 10:50 
GeneralRe: C# LINQ JOIN: Getting out of memory exception Pin
Mycroft Holmes8-Jul-19 11:31
professionalMycroft Holmes8-Jul-19 11:31 
AnswerRe: C# LINQ JOIN: Getting out of memory exception Pin
Dave Kreskowiak5-Jul-19 18:55
mveDave Kreskowiak5-Jul-19 18:55 
AnswerRe: C# LINQ JOIN: Getting out of memory exception Pin
lmoelleb9-Jul-19 22:42
lmoelleb9-Jul-19 22:42 

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.