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
darma teja
NA
496
338.5k
Problem in exporting data to chart
Nov 13 2012 7:42 AM
Hi,
I would like to make chart with taskname (on X-axis) and timetakenfortheTask (on y-axis).
in my database i have data as:
Taskname timetakenfortheTask(hrs)
Writing 1:00
printing 2:30
delivery 5:00
I wrote code like this:
With the below code i am getting all task names on x-axis. But i am not getting "timetakenfortheTask" on y-axis with times.
chart1.Enabled = true;
con.Open();
chart1.DataSource = null;
SqlCommand chartcmd = new SqlCommand("select taskname, timetakenfortheTask from Time_sheet where Name='" + cmbEmpnam.Text + "';", con);
chartcmd.Connection = con;
SqlDataAdapter chartada = new SqlDataAdapter(chartcmd);
DataSet ds = new DataSet();
chartada.Fill(ds);
DataView source = new DataView(ds.Tables[0]);
chart1.DataSource = source;
chart1.Series[0].XValueMember = "taskname";
chart1.Series[0].YValueMembers = "timetakenfortheTask";
chart1.DataBind();
con.Close();
Advance thanks,
Darma
Reply
Answers (
1
)
C#.net report
Hi! I am Not able to Update database through Datagridview in VB.net Pls help