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

C#

 
GeneralList Tables Pin
Dirso12-Jan-05 7:38
Dirso12-Jan-05 7:38 
GeneralNeed assistance with System.Diagnostics.process.startinfo.createnowindow ... Pin
new_phoenix12-Jan-05 7:08
new_phoenix12-Jan-05 7:08 
GeneralByte array to struct Pin
Arjan Schouten12-Jan-05 6:39
Arjan Schouten12-Jan-05 6:39 
GeneralRe: difference between .NET remoting and shared/private assembly? Pin
liyang yu12-Jan-05 5:58
liyang yu12-Jan-05 5:58 
Generalproblem with SQL Pin
ronin177012-Jan-05 5:40
ronin177012-Jan-05 5:40 
GeneralRe: problem with SQL Pin
Steve Maier12-Jan-05 5:45
professionalSteve Maier12-Jan-05 5:45 
GeneralRe: problem with SQL Pin
Jesse Squire12-Jan-05 6:28
Jesse Squire12-Jan-05 6:28 
GeneralRe: problem with SQL Pin
Dave Kreskowiak12-Jan-05 9:02
mveDave Kreskowiak12-Jan-05 9:02 
ronin1770 wrote:
Any idea(s) : what i am doing wrong

So many things, it's almost funny!

1) You're using string concatentation to build an SQL statement. The gods around here will smite you for such foolishness. Like the other posters pointed out, you have opened yourself up to many an SQL injection attack.

2) There is no space between the keyword BETWEEN and the single quote next to it. There should be...

3) A comma between your first date and the keyword AND will cause an error in the SQL statement.

4) Your completely at the mercy of the user to type in the date in the EXACT format that is required by the SQL statement.

We've said this a thousand times in the forums: CONVERT THIS STATEMET INTO A PARAMETERIZED QUERY! If you were to release code like this into a production application and sell it, your customers will hang you by your nads when they find out about it!

The SqlParameter objects will handle filtering for SQL Injection attacks for you and handle converting the DateTime objects you supply into the correct SQL format.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralConfiguring web service Pin
Esmo200012-Jan-05 4:38
Esmo200012-Jan-05 4:38 
GeneralRe: Configuring web service Pin
Esmo200012-Jan-05 9:57
Esmo200012-Jan-05 9:57 
Questiondifference between .NET remoting and shared/private assembly? Pin
liyang yu12-Jan-05 4:01
liyang yu12-Jan-05 4:01 
AnswerRe: difference between .NET remoting and shared/private assembly? Pin
Steve Maier12-Jan-05 4:28
professionalSteve Maier12-Jan-05 4:28 
GeneralRe: difference between .NET remoting and shared/private assembly? Pin
liyang yu12-Jan-05 4:49
liyang yu12-Jan-05 4:49 
GeneralRe: difference between .NET remoting and shared/private assembly? Pin
Steve Maier12-Jan-05 5:42
professionalSteve Maier12-Jan-05 5:42 
GeneralLinking HxS Help file to a C# application Pin
mikey_g12-Jan-05 3:49
mikey_g12-Jan-05 3:49 
GeneralDataSet Visual Desinger Persistance Pin
Lyhr12-Jan-05 2:54
Lyhr12-Jan-05 2:54 
GeneralAddNew() and default values Pin
Jonckheere12-Jan-05 2:31
Jonckheere12-Jan-05 2:31 
GeneralRe: AddNew() and default values Pin
turbochimp12-Jan-05 5:38
turbochimp12-Jan-05 5:38 
GeneralRe: AddNew() and default values Pin
Jonckheere12-Jan-05 19:29
Jonckheere12-Jan-05 19:29 
GeneralRe: AddNew() and default values Pin
turbochimp13-Jan-05 3:25
turbochimp13-Jan-05 3:25 
GeneralUI look as VS .NET Editor Pin
Md Saleem Navalur12-Jan-05 2:20
Md Saleem Navalur12-Jan-05 2:20 
GeneralRe: UI look as VS .NET Editor Pin
Jesse Squire12-Jan-05 6:43
Jesse Squire12-Jan-05 6:43 
GeneralRe: UI look as VS .NET Editor Pin
Mathew Hall13-Jan-05 23:21
Mathew Hall13-Jan-05 23:21 
GeneralCreate Click event in C# Pin
itssuk12-Jan-05 1:30
itssuk12-Jan-05 1:30 
GeneralRe: Create Click event in C# Pin
Paul Lyons12-Jan-05 2:28
Paul Lyons12-Jan-05 2:28 

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.