954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to using diferrent dropdown for the time(c#)

I'm having a problem to inserting date/time in my database..

In my database have ONE column that consists of DATE and TIME

I want use separate dropdownlist for the HOUR, MINUTE, SECOND and I want to bind it & insert it to a 1 column in database..

I need to combine the DATE and this 3 dropdown and bind it and insert it into database


can anyone help me?? please...
\

Thanks in advance

hwa
Newbie Poster
17 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

build a string

dim MyDate as string = "1/1/2008"
Dim MyTime as string = dropdownlist1.selectedvalue & ":" & dropdownlist2.selectedvalue & ":" & dropdownlist3.selectedvalue & " " & dropdownlist4.selectedvalue (AM/PM)

MyDate = MyDate & " " & MyTime

Now insert MyDate into the db.

ericstenson
Posting Whiz in Training
Team Colleague
295 posts since Dec 2007
Reputation Points: 14
Solved Threads: 29
 

Hi ericstenson,

Can you how me the code in C# instead of vb??

and my db format for this field is DateTime so cannot convert STRING to DateTime format.

what should I do

Thanks

hwa
Newbie Poster
17 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You