Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Error message during Databind in C#/Visual Studio 2008

Posted on 2008-06-19
2
Medium Priority
?
170 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 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