Forms Data Controls :: Dynamically Set Query In SQLDataSource For Chart?
Dec 14, 2010
I've been wrestling with this for a while. What I want to do SEEMS like it would be very simple, buy nothing about it so far has been. Any assistance would be absolutely outstanding.Basic concept of what I want to do is...
[Code]....
View 2 Replies
Similar Messages:
Jan 28, 2011
I have to create a line chart from a sql query. It is as follows:
[Code]....
However,I need to take PlayerName into account too.For example,if there are 2 different PlayerNames,2 different series will be shown on the line chart.
View 1 Replies
Aug 6, 2010
I've got an issue with the postback property. I have a chart (Code below) which has two series pulled from a datasource.
Both series display fine but I've enabled the bars in the chart to respond to the click event and when items from the first series is selected, everything works fine. However, I try to pull the x value for the second series, which is supposed to be a date, but all I get is an interger.
[Code]....
C# Code...
[Code]....
View 1 Replies
Feb 16, 2010
I'm using VS2008 to write a web app. The page has 3 inputs (select date from calander, and items from two dropdownlists). User will be able to select any of the three or nothing. I start with a "select * from ... and append a where stmt to my select; depending on the user's choices. Once the user has selected (or not) they will click a "get info" button. That passes the select command to the SQLDATASOURCE, where it successfully returns what was requested. If I have PAGING enabled (perferred because there could be MANY rows returned), the first 10 rows return with the appropriate page numbers. When a page number is picked (ie. 2 or next), the page reloads and the query reruns but regardless of the original query; the rerun query selects everything. Obviously, this will not work.i'll even ZIP my code and email it to "you"; if needed.
View 1 Replies
Dec 16, 2010
I can't figure out how to get the legend to populate all the "strReason" and get the correct percents to show for each column. This is where I'm at right now.
[Code]....
View 1 Replies
Feb 9, 2011
What I am trying to achieve here is as follows. I have a mailing system that works great, I have users from a datasource being looped through and having that message sent to the users that are in that datasource. But my question now is, because I will have multiple queries/datasources (for different users in the mailing system for different purposes), is there a way I can bind a datasource to a radio button and then have that selected radio button be used for the mailing datasource?
[Code]....
As you can see with this line Dim dt As DataTable = DirectCast((DatasourceOptInMembers.Select(DataSourceSelectArguments.Empty)), DataView).Table I want to have the DatasourceOptInMembers dynamic vs a statically assigned datasource. So baically if another options is selected it will use that datasource instead.It appears simple, although unsure of how to construct this.
View 10 Replies
Aug 22, 2010
1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like
SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.
Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).
2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query
(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).
If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.
View 11 Replies
May 21, 2010
I am stuck in chart controls...Here is my prob... There is a ListBox containing some items...when user selects multiple items from the list box I want to generate a dynamic table with the number of columns same as that of the number items selected in the listbox. And for each selected item I want to show a seperate chart in the columns...Currently I want the same chart control for every selected item (i.e. a static hard coded chart that i will replace later by dynamic values)....I am using a method that draws a chart control using a sample dataset... I am calling it each time when a new column is created..Also the DrawChart method executes for the first column only and throws an index out of range exception! after the first execution...my code is not working...here
my code...
[Code]....
[Code]....
View 1 Replies
Apr 27, 2016
See this code
protected void Page_Load(object sender, EventArgs e) {
chart.InitChart(new Chart {
Type = ChartTypes.Spline,
BackgroundColor = new BackColorOrGradient(System.Drawing.Color.FromName("'#f1f2f7'")),
ZoomType = ZoomTypes.X
[Code] ....
in this code I want to bind data from database in series so how can i bind data from database
in above they have two parameters in series parameter1 and parameter2.
they have hardcoded array . I want to make it dynamic.
View 1 Replies
Mar 10, 2011
It is easy to use SQLDataSource as data data source in Column chart (see code below). Is there any easy way to use SQLDATASource to fill line chart with minimum configuration? Most samples I found on the web do not use SQLDATASOURCE as data source .
[Code]....
View 3 Replies
Jul 9, 2010
I have an issue in using dot net chart control. In chart last column is not completely shown which give bad appearance and on right side of chart it looks like TickMark are enabled. I set MajorTickMark of AxisY2 disabled but still tick marks on right side.
View 2 Replies
Feb 24, 2010
how to freeze the x axis of the chart control in ms chart? need to use because data displayed at large amount that is scrollable.
View 1 Replies
Jan 28, 2011
I have a drop downlist,and next to it there is an MS bar chart.i want to change the datate of the MS chart ,once the user selects another year from the dropdownlist.
When the page loads ,the chart displays the default year(2011) and it works.The problem is that is does not change the data when you select another year from the dropdownlist.
View 1 Replies
Apr 28, 2010
Am I going mad/blind? Probably a combination of the two.
How does one go about removing the data labels from a pie chart with the new chart control in .net 4?
I can get these to display as tooltips absolutely fine, but ultiamtely I'd like the labels not to be present as it looks rather busy.
I've searched previous answers and seen code behind resolutions but surely there must be some sort of code infront option to turn these labels off?
View 2 Replies
Aug 12, 2010
I am using MS Chart control (3.5), and have a requirement where I need to display 2 pie charts. The datapoints for the pie charts is set programatically. My doubts are as follows:
1. Can I display both the pie charts in a single chart control and area, or do I have to use two controls? (Currently I am using two controls)
2. How can I maintain the same size for both the pie charts? This is my main concern, since the pie sizes keep changing, depending on the number of datapoints. I tried using custom properties like "MinimumRelativePieSize", but it's not working.
View 1 Replies
Nov 17, 2010
i'm trying to create a stacked bar chart on a vb web form using vs2010.My data source returns:
Error in Functionality Awaiting on Supplier
1IMT IssuesmActive6
IMT Issues,Awaiting on Supplier
2,IMT Issues,Awaiting on User 4
IMT Issues Closed 120
Login / Password Active
But I can't get this into a stacked chart. I know I must have to do quite a bit of work declaring what the series are and soforth, or having a different dataset but can't find any documentation on it.A link to some documentation or an example of a stacked chart from an sql datasource would be much appreciated.
View 1 Replies
May 21, 2010
I started using the awesome chart controls with my asp.net apps recently and so far they've been nothing short of breath taking. Right now I have a weird problem, on the first load of my page, the chart control appears correctly and the tooltip is correct, however, when I update it with new data, the chart displays correctly, but the tooltips are for the previous set of data.
I hope this makes sense. The first time I load the chart, the pie chart segments and tooltips are correct, after a partial postback (to get the new data), the pie chart segments are correct but the tooltips are for the previous data set.
Basically once the tooltips are set the first time, they can't be updated after that without a full page postback.
Here's how I set the tooltip:
[Code]....
Anyone else noticed this behaviour and have a work around?
Currently my only workaround is to check for a partial postback and not render the tooltip, which I'd rather not do as the tooltip display actual statistical data as opposed to the pie itself (which uses percentages).
View 2 Replies
Jul 15, 2010
I have an editable grid where user can add/edit data. They also have the option to load previously entered data from last month. When the user then clicks save, i want to readd this newly modified data as a new record for this month. So basically I want to call the insertcommand, but it does not work. My 'save' method just 'updates' the records.
Providing sqldatasource, grid and save method
<asp:SqlDataSource ID="SqlDataSourceLoadActivities" runat="server" [code].....
View 4 Replies
Feb 18, 2011
I have a strange problem...I am programatically adding an SQL SELECT query to my SqlDataSource that my GridView is bound to. If I use the follwing statement it works fine:
[Code]....
But if I use the following one, the gridview fails to load. The only way that this is different is it uses RTRIM and CAST on one of the fields:
[Code]....
I don't understand why this can be. If I try the statement exactly how it is in the query builder and run it it returns the rows no problem.
View 2 Replies
Jun 10, 2010
I have a gridview which I connect by C# and SqldataSource. I use asp.net 2.0 - 3.5.
I want to parameterized the queries and how do I do this in the C# file ? how do I set the selectparameters in C# ?. I do not want to do this in the aspx fil.
My code in C# is:
SqlDataSourceMachineName.SelectParameters.Clear();
SqlDataSourceMachineName.SelectCommand = "Select MachineName from tblMachine inner join tblLocation on tblMachine.MachineLocationID = tblLocation.LocationID where tblLocation.LocationName = 'New York' and
tblMachine.StatusID = '1'";
View 9 Replies
Sep 3, 2010
I am working with chart controls in VS 2010. I have used sqldatasource. I want to populate select values from sqldatasource and display it on the chart controls.According to the chart samples: http://code.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418the chart controls are databound in the page_load event. Then in which page event should I select data from sqldatasource?Code for sqldatasource selection
View 8 Replies
Oct 25, 2010
Currently, I have long script which does major processing and then puts data into temp table.
Finally I read data from this temp table to show on the chart, based on user's selection of parameter. So I can divide my query into two parts and while I am researching this,
Is it possible to do processing in one Datasource and read table from second datasource?Is it even possible?
If not, what is recommended method for this (breaking large processing into small one)?
View 2 Replies
Jan 20, 2011
I have this sqldatasource:
<asp:sqldatasource id="SqlDataSourceX" runat="server" connectionstring="<%$ ConnectionStrings:MyConn%>" providername="System.Data.SqlClient"
selectcommand="SELECT ItemNum, MIN(DateAdded) as [DateAdded]
FROM Items WITH (NOLOCK)
WHERE [DateAdded] between @DateFrom AND @DateTo
[Code]....
When I call select in codebehind, after 30sec it throws timeout expired SqlException:
[Code]....
again , this select took up to 3 sec to be executed. In application I tried to use SqlConnection and SqlTableAdapter instead of SqlDataSource, with the same query, and again it took up to 3 sec.
If I choose tighter interval (e.g '2011-01-20 00:00:00' - '2011-01-21 00:00:00') , there is no timeout exception, so I know that sqldatasource select is executed correctly. So the conclusion is that sql server is not using index while executing query sent from sqldatasource, but is using index whenever else. I have also checked the index statistics on sql server and it is like that. In profiler i can see slight difference between this two cases. As for SqlDataSource, in events table, in first column "EventClass" after 30 sec, there is this: "RPC:Completed" and application throws timeout. If i use SqlConnection and SqlTableAdapter then at the same place there is this: "SQL:BatchStarting" and "SQL:BatchCompleted" and application does not throws timeout(the index has been used).
what is so special on SqlDataSource connection, that Sql Server performs differently compared to other types of connections?
View 3 Replies
Feb 16, 2011
I have a query that I want to test the performance of when the query is included directly in the SqlDataSource versus when I call a stored procedure. Does anyone have suggestions on how I would be able to closely watch the actual steps here? I was thinking of turning on tracing and adding Trace.Write for each of the events that fire along the way. This doesn't seem efficient and I wanted to see if there was a better approach.
View 2 Replies
Mar 10, 2011
I've already spent hours in searching through the forum to be able to do the following:I have a SQL datasource defined with a checkbox in it. Purpose is to update one column (userid) behind the table for only that row when the checkbox is selected.This is the code I'm currently having:
[Code]....
View 4 Replies