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
john kanyora
NA
242
46.2k
barchart does not contain a definiton for datasource.
Dec 7 2017 7:26 AM
am getting the error of barchart does not contain a definition for datasource and another error of barchart does not contain a definition for valuememberX and valuememberY.
i have highlighted in red where am getting the error.
public void BindGrid()
{
// Load the name of the stored procedure where our data comes from here into commandtext
string CommandText = "enterprise.spCollectionAlerts";
// get the connection ready
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand(CommandText, myConnection);
myCommand.CommandTimeout = ConfigSettings.SqlCommandTimeout;
SqlParameter workParam = new SqlParameter();
myCommand.CommandType = CommandType.StoredProcedure;
// Set the input parameter, companyid, branchid, departmentid
// these parameters are set in the sub page_load
myCommand.Parameters.Add("@CompanyID", SqlDbType.NVarChar).Value = CompanyID;
myCommand.Parameters.Add("@BranchID", SqlDbType.NVarChar).Value = BranchID;
myCommand.Parameters.Add("@DepartmentID", SqlDbType.NVarChar).Value = DepartmentID;
// open the connection
myConnection.Open();
SqlDataReader reader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
BarChart1.DataSource = reader;
BarChart1.Series[0].ValueMemberX = "ProductName";
BarChart1.Series[0].ValueMembersY
= "TotalPurchase";
BarChart1.DataBind();
<html>
<head>
</head>
<body >
<asp:BarChart ID="BarChart1" runat="server" ChartHeight="300" ChartWidth = "450"
ChartType="Column" ChartTitleColor="#0E426C" Visible = "false"
CategoryAxisLineColor="#D08AD9" ValueAxisLineColor="#D08AD9" BaseLineColor="#A156AB">
</asp:BarChart>
</body>
</html>
Reply
Answers (
5
)
Welcome message not visibile in Webchat,but work in Emulator
Ensure Security for Code