Hi ,

i'm new to vb.net.

i wish to concatenate date and time from 2 different datetimepicker
after concatenated I want it to be save in sql database format which is yyyy-MM-dd HH:mm:ss


I'm doing half way and my query is like below.


Dim insertCmd As New SqlCommand(Sqlstr, connection)
insertCmd.Parameters.Add("@School_Subject", Data.SqlDbType.NVarChar).Value = txtSchoolSubject.Text
insertCmd.Parameters.Add("#" & SchoolDatePicker.Value & "#") ', Data.SqlDbType.NVarChar).Value = SchoolDatePicker.Text
insertCmd.Parameters.Add(" @DT_PlannedStartDt " + " " + "@DT_PlannedStartHour" + " " + "@DT_PlannedStartMin" + " " + "@DT_PlannedStartSec") ', Data.SqlDbType.NVarChar).Value = DT_PlannedStartYear.Text
insertCmd.Parameters.Add(" @DT_PlannedEndDt" + " " + "@DT_PlannedEndHour" + " " + "@DT_PlannedEndMin" + " " + "@DT_PlannedEndSec") ', Data.SqlDbType.NVarChar).Value = DT_PlannedStartYear.Text

yaya.....
because i'm taking from two different datetimepicker and i want to combined it as one so i can save it into sql database format.

u may refer to the attachment to see how my form looks like

Attachments sample.JPG 40.33 KB
This article has been dead for over six months. Start a new discussion instead.