.net - error: conversion from string to date is not valid -


i want save date using date time picker in vb.net. getting error: "conversion string date not valid"here code:

    dim con new sqlconnection(dal.conmain)         'dim trns sqltransaction         dim obj new clsproductmaster()         **obj.invoicedate = dtpdate.value.tostring("dd-mmm-yyyy")**         obj.consignor_id = ddlconsignor.selecteditem.tostring()         obj.demurrage_days = txtdemurragedays.text         obj.demurrage_rate = txtdemmuragerate.text 

type of invoicedate datetime. please help.

if invoicedate datetime property, why convert available datetime string before assign it?

so instead of

obj.invoicedate = dtpdate.value.tostring("dd-mmm-yyyy") 

just

obj.invoicedate = dtpdate.value.date 

i assume want date portion without time i've used datetime.date.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -