T
Terry
Howdy,
I'm having trouble getting a message to appear in a label.
I have the following code snippet:
lbErrorMssg.Text = ""
foreach (DataRow Rrow in ds.Tables["ImportCSV"].Rows)
{
string sString = Rrow["EmployeeNumber"].ToString();
if (!ImportCSV.IsNumeric(sString))
{
lbErrorMssg.Text = lbErrorMssg.Text + "EmployeeNumber " + sString +
"is not an integer. Please verify the EmployeeNumber." + "<BR>";
}
}
I know that this is catching non numeric entries because the label is
populated with as many error messages as I put errors in the text
data. However, the text of sString never appears in lbErrorMssg. I
replaced sString with Rrow["EmployeeNumber"].ToString(); but there was
no change. How can I make the value for the invalid EmployeeNumber
appear in the text of lbErrorMessage?
In case you are wondering what is "IsNumeric", it is a custom function
I made to mimic the built in IsNumeric function of vbscript, or isnan
from javascript.
--Terry
I'm having trouble getting a message to appear in a label.
I have the following code snippet:
lbErrorMssg.Text = ""
foreach (DataRow Rrow in ds.Tables["ImportCSV"].Rows)
{
string sString = Rrow["EmployeeNumber"].ToString();
if (!ImportCSV.IsNumeric(sString))
{
lbErrorMssg.Text = lbErrorMssg.Text + "EmployeeNumber " + sString +
"is not an integer. Please verify the EmployeeNumber." + "<BR>";
}
}
I know that this is catching non numeric entries because the label is
populated with as many error messages as I put errors in the text
data. However, the text of sString never appears in lbErrorMssg. I
replaced sString with Rrow["EmployeeNumber"].ToString(); but there was
no change. How can I make the value for the invalid EmployeeNumber
appear in the text of lbErrorMessage?
In case you are wondering what is "IsNumeric", it is a custom function
I made to mimic the built in IsNumeric function of vbscript, or isnan
from javascript.
--Terry