TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ashok Kumar
NA
38
46.1k
error occuring after storing data
Jul 27 2012 3:07 AM
Hi friends,
i am getting error after performing calculation and after storing data in database
The error is
formatExeption was unhandled
Input string was not in a correct format
the error is on
number2 = Convert.ToInt32(txtnumdays.Text);
the logic i have used to perform calculation is
string maxleave = "";
int number1;
int number2;
int returnValue = 0;
qry = "Select MaxLeave from LeaveMaster where LeaveName = '" + cmbLeave.Text.ToString() + "' ";
number2 = Convert.ToInt32(txtnumdays.Text);
DBCom.getData(qry);
if (DBCom.rdr.HasRows)
{
while (DBCom.rdr.Read())
{
maxleave = DBCom.rdr["MaxLeave"].ToString();
number1 = int.Parse(maxleave);
returnValue = Subtract(number1, number2);
txtLvslft.Text = returnValue.ToString();
please help how to solve this error
thanks
Reply
Answers (
10
)
Debug class and trace class in c#
Difference between setup project and setupwizard