Solved

Error message during Databind in C#/Visual Studio 2008

Posted on 2008-06-19
2
160 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
2 Comments
 
LVL 16

Accepted Solution

by:
ororiole earned 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
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)…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now