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

Concatenate in the Sense to add two Date Times into a single one?

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

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.