Congratulations - C# Corner Q4, 2022 MVPs Announced
Why Join
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Israel
1.1k
1.3k
183.7k
My graph doesnt appear on my form...
May 20 2014 9:35 AM
Hi!
I cannot see appearing my graph on my form.
The first error message I receive is:
The type or namespace name 'UI' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
The segond is:
The name 'SeriesChartType' does not exist in the current context
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Web.UI.DataVisualization.Charting;
//The first Error message it's here
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source=localhost\\sqlexpress;Initial Catalog=master;Integrated Security=True");
string qry = "select Name, salary from salary from employee";
SqlDataAdapter da = new SqlDataAdapter(qry, conn);
DataSet ds = new DataSet();
da.Fill(ds,"salary");
chart1.Series["Series1"].XValueMember="name";
chart1.Series["Series2"].YValueMembers="salary";
this.chart1.Titles.Add("employee salary");
chart1.Series["series1"].ChartType = SeriesChartType.Pie;
// the Segond error message it's here
chart1.Series["series1"].IsValueShownAsLabel = true;
}
}
}
Reply
Answers (
10
)
what future gaming
Need Tetris Game