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:
i have label which shows the system time and i want to pass it as parameter
i have the following method
int abc = blu.insertLogintime();

the parameter which i need to pass is label which holds the system time
please help with the code
with regards bishnu karki
Posted

1 solution

Depends on what you want to pass it as:
C#
public int insertLoginTime(DateTime dt)
Then you need to use DateTime.Parse, DateTime.ParseExact otr DateTime.TryParse on the Label.Text property.
C#
public int insertLoginTime(string s)
Then you need to pass it the Label.Text property.
C#
public int insertLoginTime(Label l)
Then you need to pass it the Label itself.
 
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