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
Prakash Mondal
NA
288
209k
How to add column in dataGridView with calculation?
Apr 5 2018 5:05 AM
I load a dataGridview using DataTable.
suppose:
public void loadGrid()
{
con.open();
SqlDataAdapter da= new SqlDataAdapter ("SELECT * FROM COMMISION_TB",con);
DataTable dt = new DataTable();
da.Fill(dt);
con.close();
dataGridview.AutogeneratedColumn=false;
dataGridview1.DataSource=dt;
}// I wite this code in notepad
Like that...
Empno
Name
Dept
Basic Salary
Commision (%)
Status
E123
Priya
EC
32500
2
Paid
E124
Riya
EN
20800
3.5
Paid
E125
Jiya
GG
29500
1.5
Paid
I want to display the total paid amount (basic salary+(basic salary * commission) ) in this gridview as column, that is
Empno
Name
Dept
Basic Salary
Commision (%)
Total Amount
Status
E123
Priya
EC
32500
2
33150
Paid
E124
Riya
EN
20800
3.5
21528
Paid
E125
Jiya
GG
29500
1.5
29942.5
Paid
Please give me solution.
Reply
Answers (
5
)
Cascading model binding using JSON.
The underlying connection was closed...