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
Emma Emma
NA
101
55.3k
C# datagridview two column multiple each other
Jun 28 2013 5:02 AM
Hi,
I have one problem when I am trying to multiply two column's value with each other.Here is how it looks like:
-----Value-------Amplifier
-----30222-----0.002
------22222-----0.004
------0-----------0.01
what I want is Column of Value multiply Amplifer and store the result in Value column.
Here is my code:
for
(
int
n = 0; n < (dataGridView1.Rows.Count-1); n++)
{
double
i=
Convert
.ToDouble(dataGridView1.Rows[n].Cells["Value"].Value.ToString());
double
j=
Convert
.ToDouble(dataGridView1.Rows[n].Cells[
"Amplifier"
].Value.ToString());
dataGridView1.Rows[n].Cells["Value"].Value=
Convert
.ToString(i*j);
}
But I get one error in Here:
double
j=
Convert
.ToDouble(dataGridView1.Rows[n].Cells[
"Amplifier"
].Value.ToString());
which said : Input string was not in a correct format.
can anyone help me out with this...Thanks a lot
Reply
Answers (
19
)
Print Window Form with high quality text
Access MyDocuments folder is denied