Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...stringToNumber errorstringToNumber error
Previous
 
Next
New Post
3/17/2009 11:14 AM
 

Hello,

I don't think this is a dnn thing, but more of a general programming isssue.  I have been having a weird exception that shows up occassionally.  I have a custom module for user registration.  The exception is:

ModuleId: 811
ModuleDefId: 136
FriendlyName: New Student Registration
ModuleControlSource: DesktopModules/Registration/StudentRegister.ascx
AssemblyVersion: 04.09.02
PortalID: 1
PortalName: My Portal
UserID: -1
UserName:
ActiveTabID: 185
ActiveTabName: Student_Register
RawURL: /tabid/185/ctl/StudentRegistration/mid/811/default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://MyDomain/tabid/185/ctl/StudentRegistration/mid/811/default.aspx
UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 954d4703-3f0a-4da0-b99a-e35f8e4367ef
InnerException: Input string was not in a correct format.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Number.StringToNumber
StackTrace:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Input string was not in a correct format. ---> System.formatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberformatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberformatInfo info) at MyCompany.Modules.Registration.StudentRegister.RegisterStudent() --- End of inner exception stack trace ---

 

I can't recreate the error, and I haven't seen it on Internet Explorer.  It shows up when users register using Safari or Firefox.  I assume this error shows up when trying to parse a decmial, but there is only one field that uses a decimal and this is how I'm passing it in.

 

 

Dim gpa As Decimal = Null.NullDecimalIf Decimal.TryParse(Trim(txtGPA.Text), gpa) Then

.GPA = gpa

 

Else

.GPA = Null.NullDecimal

 

End If

Any ideas, is there something I need to check when validating this that I'm missing?

Thanks for any help.

Gregg 

 

 

 

 
New Post
3/17/2009 12:44 PM
 

 

See if this helps.

http://support.microsoft.com/kb/942460

 

 
New Post
3/17/2009 12:55 PM
Accepted Answer 

Hi Gregg,

The source if this error is not a decimal-parsing issue, but rather related to the parsing of an int32.  You'll need to look at (and optionally post) other relevant sections of your code for assistance here.

Hope this gets you started!

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
3/18/2009 4:23 PM
 

Will this work for me or do I need to do more validation on the server side?  I'm just doing a integer.tryparse to make sure the text is an integer.

 

 

If Not Integer.TryParse(Trim(txt.Text), intTest) Then

lblMessage.Text &= lbl.Text &

" is invalid"

txt.Focus()

isValid =

False

 

End If

Thanks for both of your responses.

Gregg

 

 
New Post
3/18/2009 6:58 PM
 

Hi Gregg,

I don't see anything particularly suspicious there -- are you sure you don't have another conversion (explicit or otherwise) anywhere in that handler?

Brandon


Brandon Haynes
BrandonHaynes.org
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...stringToNumber errorstringToNumber error


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out