Re: missing text in a label
From: Martin Dechev (detcheff__at_hotmail.com)
Date: 03/03/04
- Next message: Ganesh Ramamurthy: "aspnet_wp.exe stopped unexpectedly"
- Previous message: Steve Drake: "Re: force reload of application from asp.net"
- In reply to: Terry: "missing text in a label"
- Next in thread: Terry: "Re: missing text in a label"
- Reply: Terry: "Re: missing text in a label"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 3 Mar 2004 10:10:13 +0100
Hi, Terry,
Did you try to debug the code? What is the value of sString shown in the
debugger? Maybe it is an empty string. Try printing sString.Length.
Hope this helps
Martin
"Terry" <NTuser_Man@msn.com> wrote in message
news:55ea4867.0403021551.3c8204d0@posting.google.com...
> 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
- Next message: Ganesh Ramamurthy: "aspnet_wp.exe stopped unexpectedly"
- Previous message: Steve Drake: "Re: force reload of application from asp.net"
- In reply to: Terry: "missing text in a label"
- Next in thread: Terry: "Re: missing text in a label"
- Reply: Terry: "Re: missing text in a label"
- Messages sorted by: [ date ] [ thread ]