Click here to Skip to main content
15,898,987 members
Home / Discussions / C#
   

C#

 
QuestionRegistry Pin
sanforjackass28-Dec-09 7:39
sanforjackass28-Dec-09 7:39 
QuestionCreating a Class that can be a list? Pin
bbranded28-Dec-09 5:20
bbranded28-Dec-09 5:20 
AnswerRe: Creating a Class that can be a list? Pin
Luc Pattyn28-Dec-09 5:37
sitebuilderLuc Pattyn28-Dec-09 5:37 
GeneralRe: Creating a Class that can be a list? Pin
bbranded28-Dec-09 5:40
bbranded28-Dec-09 5:40 
GeneralRe: Creating a Class that can be a list? Pin
Luc Pattyn28-Dec-09 7:13
sitebuilderLuc Pattyn28-Dec-09 7:13 
GeneralRe: Creating a Class that can be a list? Pin
DaveyM6928-Dec-09 10:23
professionalDaveyM6928-Dec-09 10:23 
GeneralRe: Creating a Class that can be a list? Pin
ProtoBytes28-Dec-09 12:14
ProtoBytes28-Dec-09 12:14 
GeneralRe: Creating a Class that can be a list? Pin
Luc Pattyn28-Dec-09 12:19
sitebuilderLuc Pattyn28-Dec-09 12:19 
AnswerRe: Creating a Class that can be a list? Pin
Saksida Bojan28-Dec-09 5:37
Saksida Bojan28-Dec-09 5:37 
AnswerRe: Creating a Class that can be a list? Pin
#realJSOP28-Dec-09 9:44
professional#realJSOP28-Dec-09 9:44 
QuestionFew questions Pin
Saksida Bojan28-Dec-09 5:04
Saksida Bojan28-Dec-09 5:04 
AnswerRe: Few questions Pin
ProtoBytes28-Dec-09 6:48
ProtoBytes28-Dec-09 6:48 
GeneralRe: Few questions Pin
Saksida Bojan28-Dec-09 8:50
Saksida Bojan28-Dec-09 8:50 
GeneralRe: Few questions Pin
ProtoBytes28-Dec-09 9:15
ProtoBytes28-Dec-09 9:15 
AnswerRe: Few questions Pin
DaveyM6928-Dec-09 10:42
professionalDaveyM6928-Dec-09 10:42 
GeneralRe: Few questions Pin
Saksida Bojan28-Dec-09 11:33
Saksida Bojan28-Dec-09 11:33 
GeneralRe: Few questions Pin
ProtoBytes28-Dec-09 12:12
ProtoBytes28-Dec-09 12:12 
QuestionNetwork permission for Windows service Pin
Priya Prk28-Dec-09 4:56
Priya Prk28-Dec-09 4:56 
AnswerRe: Network permission for Windows service Pin
Blikkies28-Dec-09 5:33
professionalBlikkies28-Dec-09 5:33 
AnswerRe: Network permission for Windows service Pin
Dave Kreskowiak28-Dec-09 5:33
mveDave Kreskowiak28-Dec-09 5:33 
GeneralRe: Network permission for Windows service Pin
Priya Prk28-Dec-09 6:07
Priya Prk28-Dec-09 6:07 
Question[Message Deleted] Pin
santhosh-padamatinti28-Dec-09 2:14
santhosh-padamatinti28-Dec-09 2:14 
AnswerRe: please answer Pin
Dave Kreskowiak28-Dec-09 3:56
mveDave Kreskowiak28-Dec-09 3:56 
Questioninsert datetime to database Pin
Erdinc2728-Dec-09 1:48
Erdinc2728-Dec-09 1:48 
AnswerRe: insert datetime to database Pin
OriginalGriff28-Dec-09 2:14
mveOriginalGriff28-Dec-09 2:14 
Without seeing your code, it is difficult to answer accurately, but:

I assume from your brief description that you are using DateTimePicker.Text to access the selected date? If so, then DateTimePicker has a Value property, which is a DateTime.
Use code similar to the following to insert the date into the database:
DateTime dt = dateTimePicker1.Value;
SqlCommand cmd = new SqlCommand("INSERT INTO myTable (DateColumn) VALUES (@DT)");
cmd.Parameters.AddWithValue("@DT", dt);
...

You are absolutly right not to keep the date in the database as a string! A DateTime or SmallDateTime is much better. Thumbs Up | :thumbsup:

[edit]Types wrong: should be DateTime and SmallDateTime[/edit]

All those who believe in psycho kinesis, raise my hand.

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.