Hello, I have one DateTimePicker and two textbox (txtHour and txtMinute)
I want insert the value of datetimepicker (date) and textbox (hour and minute from two different textbox) to DateTime data type on my table, example: 2013-08-28 12:30:00 PM --> the value of 12 got from txtHour, the value of 30 got from txtMinute
How to do that?
Thanks
lwin
0
Newbie Poster
Recommended Answers
Jump to Postyou can try like this, if i wrong please inform me
Dim dr As DataRow = DBDataSet.Tables("Table").NewRow cmdIn1 = conn.CreateCommand cmdIn1.CommandText = "INSERT INTO Table(Name, Sex, DateTime)VALUES('" & Trim(Name.Text) & "','" & Trim(Sex.Text) & "','" & Trim(DateTimePicker.Value) & "')" check = cmdIn1.ExecuteReader.RecordsAffected() If check > 0 Then …
Jump to PostNice job Iwin....for easy code, you can only insert the datetimepicker.value and it will save your date and time for column type = datetime.
All 5 Replies
Hazuan Nazri
0
Junior Poster in Training
lwin
0
Newbie Poster
Hazuan Nazri
0
Junior Poster in Training
lwin
0
Newbie Poster
Hazuan Nazri
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.