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
john kanyora
NA
242
46.3k
Input string was not in a correct format.
Dec 20 2017 3:54 AM
Hi, am converting string to decimal because i want my values to be represented in decimal form in my bar chart.am getting the error that " Input string was not in a correct format"..
the error is in this line y[i]=Convert.ToDecimal(string.Format("{0}.00",dt.Rows[i][1].ToString()));
am usin this code below
string[] x = new string[dt.Rows.Count];
decimal[] y = new decimal[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
x[i] = dt.Rows[i][0].ToString();
y[i]=Convert.ToDecimal(string.Format("{0}.00",dt.Rows[i][1].ToString()));
}
BarChart1.Series.Add(new AjaxControlToolkit.BarChartSeries {Data=y });
BarChart1.CategoriesAxis = string.Join(",", x);
BarChart1.ChartWidth = 500.ToString();
BarChart1.ChartHeight = 600.ToString();
}
kindly help
Reply
Answers (
16
)
How to apply css to a button after on click in repeater
Checking Accessibility of a View in MVC5