Click here to Skip to main content
15,900,641 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello friends, i m under a minor problem , what i need to do is pass a datetime value as parameter in the method
the method is like
int abc = blu.insertLogintime(?)

inside ?, i have to send datetime which is hold by label lbldatetime,

i have method as

public int insertLogintime(int employeeid,DateTime logintime)
{
}

this datetime logintime requires datetime type parameter which is hold by label. how to do this please help?
with regards bishnu karki
Posted

As I told you last time you asked this: how to pass datetime as parameter[^]
You need to use DateTime.Parse[^], DateTime.ParseExact[^] or DateTime.TryParse[^] on the Label.Text property
 
Share this answer
 
it is very easy like griff said above

pass
datetime.parse(lbldatetime.text) as your datetime parameter
 
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