?
Solved

Error message during Databind in C#/Visual Studio 2008

Posted on 2008-06-19
2
Medium Priority
?
167 Views
Last Modified: 2013-12-16
I am trying to databind an integer from a text box and am getting the following error:

System.FormatException was unhandled
  Message="Input string was not in a correct format."
  Source="mscorlib"

I am successfully populating a text box with a number - say 21139.

This is the line of code I am getting the error on:

mortgee.MortId = int.Parse(this.txtNextMortId.Text.ToString());

Where mortgee is a business object i have created, and MortId is a public member that is an integer.

Any Ideas.. I hope I described this ok.

I try to bind to this value with the below code:
0
Comment
Question by:jamesdean666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
ororiole earned 2000 total points
ID: 21825167
Its telling you that your input string has non integer chars in it. Alphas, whatever, that it cant convert to an integer. So look at what you are passing to int.Parse.
0
 

Author Closing Comment

by:jamesdean666
ID: 31468879
Thanks.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question