Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have populated a datagridview with dates from a database and I want to transfer the value to a datetimepicker.

How do you fix the code below?

C#
this.dtpfromPO.Value = dsProduct.Tables["Orders"].Rows[RowPosition]["DateOrdered"].ToString();
Posted
Updated 3-Sep-17 1:49am
Comments
Abdul Quader Mamun 17-Jul-12 0:13am    
in which event you are doing this?

1 solution

Try this:


this.dtpfromPO.Value =Convert.ToDateTime(dsProduct.Tables["Orders"].Rows[RowPosition]["DateOrdered"].ToString());
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900