Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
S.dob=txtdob.text cannot implicitly convert type string to system.datetime I use text box for date of birth field but I got error how to solve

What I have tried:

S.dob=txtdob.text  cannot implicitly convert type string to system.datetime I use text box for date of birth field but I got error how to solve
Posted
Updated 5-Jan-18 4:24am

1 solution

S.dob is obviously a datetime. txtDob.Text is obviously, well, Text! A string.
So convert the string before assigning it to the datetime
How to: Convert a String to a DateTime (C# Programming Guide) | Microsoft Docs[^]
 
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