Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:01:29+00:00 2026-06-12T08:01:29+00:00

I have a asp.net page in which I have a chart that I dragged

  • 0

I have a asp.net page in which I have a chart that I dragged on from the toolbox designer. I know that if I click on this chart, a “chart tasks” menu will appear so that I can define the sql data source, chart type and x&y values. The problem I am having is that my sql data source requires user input. I want the user to input a date and search records based on the input date. Therefore, I cant define an sql query on the chart tasks menu because it will tell me that my query is invalid. My code looks like this so far:

con1.Open();
    SqlCommand cmd2 = new SqlCommand (string.Format ("select CustomerName, AccountNumber,  DateReading, Time, ID from dbo.NewLogTable join dbo.CustomerTable on ID = Customer_ID join dbo.VoltageTable on Voltage_Reading = Provided_Voltage where Sensor_ID = 'FA0009' and DateReading= '{0}' " ,TextBox1.Text), con1);
    SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
    DataSet ds2 = new DataSet();
    da2.Fill(ds2);
    Chart2.DataSource = da2;
    Chart2.Visible = true;
    Chart2.DataBind();

    con1.Close();

whenever I input the date and click the button, nothing happens. I know the sqlCommand is correct. However, I can not find a way to set the x and y values for my chart. I tried Chart2.Xvalue and .parameters and cant find a way to set those. I think that is whats giving me trouble. Can anyone shed some light on this issue? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:01:32+00:00Added an answer on June 12, 2026 at 8:01 am

    Use:

    You have to assign DataSet ds2 as DataSource for your chart instead of using SqlDataAdapter da2.

    Chart2.DataSource = ds2;
    

    instead of

    Chart2.DataSource = da2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which contains a html.RenderPartial, that renders an ASP.NET MVC partial
I have an ASP.net page which contains some controls. I generate this controls by
I have an ASP.NET page which has report viewer control to access reports from
I have a asp.net page which is inherited from a master page .I want
I have this ASP.NET page which I would like to print. What I am
I have an asp.net page which loads and writes values from a record to
I have a this asp.net page which upon first time load: 1: Make a
I have an ASP.NET page which includes markup and 3rd party controls (in this
I have one Asp.net MVC3 page which renders details of a Mobile. This page
I have an asp.net page which displays different colors..It looks something like this. Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.