Click here to Skip to main content
15,915,328 members
Home / Discussions / C#
   

C#

 
AnswerRe: Disposing of values in foreach loop Pin
PIEBALDconsult14-Oct-11 11:11
mvePIEBALDconsult14-Oct-11 11:11 
GeneralRe: Disposing of values in foreach loop Pin
CCodeNewbie14-Oct-11 11:16
CCodeNewbie14-Oct-11 11:16 
GeneralRe: Disposing of values in foreach loop Pin
PIEBALDconsult14-Oct-11 11:47
mvePIEBALDconsult14-Oct-11 11:47 
GeneralRe: Disposing of values in foreach loop Pin
CCodeNewbie14-Oct-11 11:56
CCodeNewbie14-Oct-11 11:56 
GeneralRe: Disposing of values in foreach loop Pin
PIEBALDconsult14-Oct-11 12:04
mvePIEBALDconsult14-Oct-11 12:04 
GeneralRe: Disposing of values in foreach loop Pin
CCodeNewbie14-Oct-11 21:50
CCodeNewbie14-Oct-11 21:50 
GeneralRe: Disposing of values in foreach loop Pin
PIEBALDconsult15-Oct-11 4:22
mvePIEBALDconsult15-Oct-11 4:22 
AnswerRe: Disposing of values in foreach loop Pin
Luc Pattyn14-Oct-11 15:12
sitebuilderLuc Pattyn14-Oct-11 15:12 
As PIEBALD already said:

1.
strings are intended for holding text, i.e. sequences of characters that don't have any particular meaning the computer may be interested in. Dates and times, integer numbers, real numbers, all have their proper types, both in programming languages and in SQL and other databases.

2.
The DateTime types in the database allow for sorting chronologically, as well as for date operations (there are functions to get to date parts: year, month, etc).

3.
formatting data is a job of the front-end program, not the database. A database just holds the data, without worrying aboiut formatting; you don't want to modify your database just because someone wants a different format; and what if different users want different formats? You don't store numbers as strings, for the sake of e.g. forcing leading zeroes; if that is what you need, get your code to deal with it. Similarly, you don't store dates and times as strings, they are inherently numbers, no more, no less.

4.
When writing SQL commands that need literal values, always use parameters, never have literal values in your SQL string itself. (You seem to be doing that right already).

5.
Never deviate from the above, it will bite you very badly.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
iSad

GeneralRe: Disposing of values in foreach loop Pin
PIEBALDconsult14-Oct-11 16:43
mvePIEBALDconsult14-Oct-11 16:43 
AnswerRe: Disposing of values in foreach loop Pin
Luc Pattyn14-Oct-11 16:58
sitebuilderLuc Pattyn14-Oct-11 16:58 
QuestionNeed help reading 64bit registry keys from a 32bit application, remotely Pin
turbosupramk314-Oct-11 7:01
turbosupramk314-Oct-11 7:01 
AnswerRe: Need help reading 64bit registry keys from a 32bit application, remotely Pin
André Kraak14-Oct-11 8:55
André Kraak14-Oct-11 8:55 
GeneralRe: Need help reading 64bit registry keys from a 32bit application, remotely Pin
turbosupramk317-Oct-11 8:15
turbosupramk317-Oct-11 8:15 
GeneralRe: Need help reading 64bit registry keys from a 32bit application, remotely Pin
turbosupramk318-Oct-11 6:25
turbosupramk318-Oct-11 6:25 
GeneralRe: Need help reading 64bit registry keys from a 32bit application, remotely Pin
turbosupramk318-Oct-11 11:54
turbosupramk318-Oct-11 11:54 
GeneralRe: Need help reading 64bit registry keys from a 32bit application, remotely Pin
turbosupramk318-Oct-11 12:49
turbosupramk318-Oct-11 12:49 
SuggestionRe: Need help reading 64bit registry keys from a 32bit application, remotely Pin
André Kraak19-Oct-11 9:19
André Kraak19-Oct-11 9:19 
GeneralRe: Need help reading 64bit registry keys from a 32bit application, remotely Pin
turbosupramk319-Oct-11 12:24
turbosupramk319-Oct-11 12:24 
QuestionCodeParser for C# source code Pin
Bernhard Hiller14-Oct-11 3:27
Bernhard Hiller14-Oct-11 3:27 
AnswerRe: CodeParser for C# source code Pin
PIEBALDconsult14-Oct-11 4:34
mvePIEBALDconsult14-Oct-11 4:34 
GeneralRe: CodeParser for C# source code Pin
Bernhard Hiller16-Oct-11 20:50
Bernhard Hiller16-Oct-11 20:50 
Questionto create a video file from a list of bitmap picture files in C sharp Pin
Member 823309513-Oct-11 17:34
Member 823309513-Oct-11 17:34 
AnswerRe: to create a video file from a list of bitmap picture files in C sharp Pin
AditSheth13-Oct-11 18:58
AditSheth13-Oct-11 18:58 
QuestionWindows 7: Getting The 'preview' file icon Pin
Michael Handschuh13-Oct-11 13:11
Michael Handschuh13-Oct-11 13:11 
AnswerRe: Windows 7: Getting The 'preview' file icon Pin
Ravi Bhavnani13-Oct-11 16:17
professionalRavi Bhavnani13-Oct-11 16:17 

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.