G
Guest
Hi I have the method below that returns a bool, true or false depending
on if the conversion to date tiem works. It takes a string input. I am
only returning the bool but would also like to return the string message
ex.message, just wondering how to do this since I think you can only return
one thing with the function. Thanks.
public bool checkdate(String s_date)
{
b_convert = true ;
DateTime dt_temp1 = Convert.ToDateTime("1/1/1980");
try
{
dt_temp1 = Convert.ToDateTime(s_date);
}
catch (Exception ex)
{
errormsg = ex.Message;
b_convert = false;
}
return b_convert;
}
on if the conversion to date tiem works. It takes a string input. I am
only returning the bool but would also like to return the string message
ex.message, just wondering how to do this since I think you can only return
one thing with the function. Thanks.
public bool checkdate(String s_date)
{
b_convert = true ;
DateTime dt_temp1 = Convert.ToDateTime("1/1/1980");
try
{
dt_temp1 = Convert.ToDateTime(s_date);
}
catch (Exception ex)
{
errormsg = ex.Message;
b_convert = false;
}
return b_convert;
}