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
Nozibulla Bashar
NA
28
7.7k
Retriving Data,Perform Calculations and show those data
Mar 29 2015 6:58 AM
I am new to C#. I am working on a school result management system.I am taking result as input of a student in a table 'tblAddResult' where i have 7 column subject, january, february,march,marks, attendence, working_day.Now in datagrid view i want to show a column name average which is the average of january, february and march. and another column which is the 40% of marks column. I use method below for storing the data
public SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Nozibulla.Bashar\\documents\\visual studio 2010\\Projects\\School Result Management System\\School Result Management System\\SRMS.mdf;Integrated Security=True;User Instance=True");
public SqlCommand cmd;
cmd = new SqlCommand ("INSERT INTO tblAddResult (Subject, Janu, feb, march, Marks, [Working Day], Attendence) VALUES ('" + cbSubject.Text + "','" + tbJanu.Text + "','" + tbFeb.Text + "','" + tbMarch.Text + "','" + tbMarks.Text + "','" + tbWorkingDay.Text + "','" + tbAttendence.Text + "')", con); con.Open(); cmd.ExecuteNonQuery();
Reply
Answers (
1
)
page break
color alternate rows in a table