we r trying to insert date from datetime picker into mssqlserver 2005 but it also enter defult time(00:00) with it in database.
using we want only date...

& xyzdtp.value.date &

you can do like this

datetimepicker.value.date.tostring()
'or you can set format property according to your requirement .

Regards

Edited 4 Years Ago by M.Waqas Aslam: n/a

and if you have datatype datetime in your db , then auto time will be added in your records , this will not effect any thing , and you can perform any task.

Regads

and if you have datatype datetime in your db , then auto time will be added in your records , this will not effect any thing , and you can perform any task.

Regads

'ya in mssql2005 datatype is datetime so...but it affect while comparing....
'also using formate property it enter time in database..

Edited 4 Years Ago by jaimin4829: n/a

dateTimePicker1.DataBindings.Add("text", dataGridView1.DataSource, "Ngaysinh");
I try get dd/mm/yyyy from datagridview but datagirdview show mysql: ex: 12/02/1990 12:00:00.
how to show datetimepicker when i click datagridview row

I use it simple way. just: datetimepicker.text

but you have to change the format from LONG to CUSTOM

and at CostumFormat use any format you want
dddd-MM-yyyy = 11-4-2015

You can use:

Dim startDate as String
startDate = DateTimePicker1.Value.ToString("yyyy/MM/dd")

Or:

Dim startDate as String
startDate = DateTimePicker1.Value.Date

change the datatype of startDate from datetime to date in your sql server

This will solve the problem.

Edited 1 Year Ago by JerrimePatient

This article has been dead for over six months. Start a new discussion instead.