Apr 29, 2016 at 10:16pm UTC
I am writing a Library management systemwindows form app in c#. I wrote a function to issue books and now I am trying to pass parameters to it when the issue button is clicked but I get a converion error for the 3rd and 4 parameter.
<lib.BookIssue(txtAddMemName.Text, txtAddBookName.Text, DateTime.Now.ToShortDateString(), dtpAddReturnD.Value.ToShortDateString());>
dtpAddReturnD is a datetimepicker. Where is my mistake??
Apr 30, 2016 at 2:10am UTC
This is not a C++ question...
...but you should post the actual error you are getting.
Apr 30, 2016 at 4:10pm UTC
What parameters does lib.BookIssue expect ?
Apr 30, 2016 at 6:29pm UTC
The error I get is
Error CS1503 Argument 3: cannot convert from 'string' to 'System.DateTime' and the same thing for argument 4.
this is what lib.BookIssue expects
BookIssue(string fullName, string bookTitle, DateTime issuedate, DateTime returndate)
Apr 30, 2016 at 7:57pm UTC
Thanks guys, I found my mistake. I was converting the time to short when it wasn't necessary. It was already in DateTime.