Click here to Skip to main content
15,902,908 members
Home / Discussions / C#
   

C#

 
AnswerRe: [Are these maybe Macros ?? ] How can i do it? Pin
Heath Stewart6-Feb-05 6:56
protectorHeath Stewart6-Feb-05 6:56 
QuestionNetwork Monitoring in C#? Pin
TroyPalmer5-Feb-05 21:53
TroyPalmer5-Feb-05 21:53 
AnswerRe: Network Monitoring in C#? Pin
TroyPalmer8-Feb-05 11:38
TroyPalmer8-Feb-05 11:38 
Generalthreadsafe / static, general utilities Pin
pkellner5-Feb-05 20:32
pkellner5-Feb-05 20:32 
GeneralRe: threadsafe / static, general utilities Pin
Heath Stewart6-Feb-05 6:43
protectorHeath Stewart6-Feb-05 6:43 
GeneralRe: threadsafe / static, general utilities Pin
pkellner6-Feb-05 12:21
pkellner6-Feb-05 12:21 
GeneralRe: threadsafe / static, general utilities Pin
Heath Stewart7-Feb-05 6:31
protectorHeath Stewart7-Feb-05 6:31 
GeneralRe: threadsafe / static, general utilities Pin
Heath Stewart6-Feb-05 6:48
protectorHeath Stewart6-Feb-05 6:48 
Oh, and using string concatenation to create SQL expressions is a terribly BAD idea. All I have to do is pass 0 OR 1=1; DROP TABLE HillFile -- and bye bye HillFile data. I could do a lot worse, too, depending on the content which I could easily discover since most RDBMS expose schema information that can be queried, like SQL Server and Access.

Use parameterized queries. See the SqlCommand.Parameters property documentation[^], as well as the SqlParameter class documentation[^] for details and examples. This also could be the reason you're getting an exception, if you're passing in string data that includes quotes anywhere. Using parameterized commands aleviates this problem, as well as avoiding SQL injection attacks. If you're getting a SqlException, which is most like the problem.

And, BTW, if your applications "crashes" because of an exception thrown, you really need to handle exceptions better. There is no reason - short of a catastrphic failure and in order to protect data - that an application should crash. Always validate your data and handle problem areas with try-catch blocks.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: threadsafe / static, general utilities Pin
pkellner6-Feb-05 12:19
pkellner6-Feb-05 12:19 
QuestionDifferent ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster5-Feb-05 20:07
DaMagicMaster5-Feb-05 20:07 
AnswerRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart6-Feb-05 6:42
protectorHeath Stewart6-Feb-05 6:42 
AnswerRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster6-Feb-05 16:39
DaMagicMaster6-Feb-05 16:39 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart7-Feb-05 6:35
protectorHeath Stewart7-Feb-05 6:35 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster7-Feb-05 12:50
DaMagicMaster7-Feb-05 12:50 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart7-Feb-05 15:39
protectorHeath Stewart7-Feb-05 15:39 
GeneralDelete XmlNode Pin
John L. DeVito5-Feb-05 19:31
professionalJohn L. DeVito5-Feb-05 19:31 
GeneralRe: Delete XmlNode Pin
Stefan Troschuetz5-Feb-05 21:07
Stefan Troschuetz5-Feb-05 21:07 
GeneralRe: Delete XmlNode Pin
Heath Stewart6-Feb-05 6:33
protectorHeath Stewart6-Feb-05 6:33 
GeneralRe: Delete XmlNode Pin
John L. DeVito8-Feb-05 12:01
professionalJohn L. DeVito8-Feb-05 12:01 
Questionhow to make what SelectionIndent does in tabs Pin
ektoras5-Feb-05 13:46
ektoras5-Feb-05 13:46 
AnswerRe: how to make what SelectionIndent does in tabs Pin
Heath Stewart6-Feb-05 6:29
protectorHeath Stewart6-Feb-05 6:29 
GeneralRe: how to make what SelectionIndent does in tabs Pin
ektoras14-Feb-05 0:59
ektoras14-Feb-05 0:59 
GeneralDifferent font colors in textbox Pin
MG00c2x5-Feb-05 11:47
MG00c2x5-Feb-05 11:47 
GeneralRe: Different font colors in textbox Pin
mav.northwind6-Feb-05 3:56
mav.northwind6-Feb-05 3:56 
GeneralRe: Different font colors in textbox Pin
sugunet7-Feb-05 1:38
sugunet7-Feb-05 1:38 

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.