|
As a part of my project, I am trying to plot Multiple series on Chart Control. But I am finding only One type of series.
<pre lang="c#">
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
string sqlquery = "select " + dd_axisX.SelectedValue.ToString() + ", " + dd_axisY.SelectedValue.ToString() + " from retrospect where locid=" +ds.Tables[0].Rows[i]["locid"] .ToString();
System.Data.DataSet ds_ValuesToPlot = new System.Data.DataSet();
da = new MySqlDataAdapter(sqlquery, con);
da.Fill(ds_ValuesToPlot, "ValuesToPlot");
chrt_ScatterPlot.DataSource = ds_ValuesToPlot;
chrt_ScatterPlot.Series.Add(ds.Tables[0].Rows[i]["locname"].ToString());
//chrt_ScatterPlot.ChartAreas.Add(ds.Tables[0].Rows[i]["locname"].ToString());
chrt_ScatterPlot.Series[ds.Tables[0].Rows[i]["locname"].ToString()].ChartArea = "ChartArea1";
chrt_ScatterPlot.Series[ds.Tables[0].Rows[i]["locname"].ToString()].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Point;
chrt_ScatterPlot.Series[ds.Tables[0].Rows[i]["locname"].ToString()].XValueMember = dd_axisX.SelectedValue;
chrt_ScatterPlot.Series[ds.Tables[0].Rows[i]["locname"].ToString()].YValueMembers = dd_axisY.SelectedValue;
System.Web.UI.DataVisualization.Charting.Legend lgd = new System.Web.UI.DataVisualization.Charting.Legend(ds.Tables[0].Rows[i]["locname"].ToString());
chrt_ScatterPlot.Legends.Add(lgd);
chrt_ScatterPlot.DataBind();
chrt_ScatterPlot.ChartAreas[0].Axes[0].Title = "AxisX";//dd_axisX.SelectedValue.ToString();
chrt_ScatterPlot.ChartAreas[0].Axes[1].Title = "AxisY";//dd_axisY.SelectedValue.ToString();
//chrt_ScatterPlot.DataManipulator.FinancialFormula(System.Web.UI.DataVisualization.Charting.FinancialFormula.Forecasting, "Exponential,3,false,false", chrt_ScatterPlot.Series[0].Name.ToString(), chrt_ScatterPlot.Series[1].Name.ToString());
}
</pre>
|
|
|
|
|
It's hard to read this but I don't see you adding another series. What is your question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
There is a line in the code for adding a series.
chrt_ScatterPlot.Series.Add(ds.Tables[0].Rows[i]["locname"].ToString());
The for loop loops to add some number of series.
But Finally I can View only one series. I am no able to attach an image here to show you the final plot on chart control.
|
|
|
|
|
And you have debugged it and are sure it is running more than one time?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Yes.. I can see the legend which shows different series colors..
|
|
|
|
|
Sounds like you may be getting the exact same data then and it is just plotting on top of itself.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have plotted the series individually and observed that the series are different.
|
|
|
|
|
Hi,
How can I store data of Gridview to a table of SQL Database.? For Example:
The Gridview has following columns:
1. Name
2. Country
3. Job
4. DOB5. Email
All these data in the Gridview should be stored in the table named "contacts" under right columns (Name,Country, Job, DOB, Email) in SQL.
Please advise on how to implement this using VB.NET.
|
|
|
|
|
Quote: Gridview-Displays the values of a data source in a table where each column represents a field and each row represents a record. The GridView control enables you to select, sort, and edit these items.
This is what MSDN Says.
Gridview is used to display the data which is bind from either database or from datatable.
If you wants to store data in database then get the datasource and insert it.
To learn all there is to know. I know I'll be disappointed one day, but I've made a good start, and the eventual disappointment is likely to be brief.
-Roger Wright
|
|
|
|
|
Dear Folk,
You first need to create an table named "Contact" within your database,
Query will be :
Create table contact
(
Contact_ID int IDENTITY(1,1) not null,
Name varchar(100) null
Country varchar(100) null
Job varchar(100) null
DOB datetime null,
Email varchar(50) null
CONSTRAINT PK_Contact PRIMARY KEY ([Contact_ID])
)
Doing so you get the table schema where you dump the data from front end [your page].
|
|
|
|
|
Hi Ajay,
Thank you for your reply,
All what i need is I was able to bind data from an excel file to gridview. Now the data from the Gridview need to be imported to the table in SQL. Therefore, how can we loop through each record in Gridview and store in respective columns in SQL table?
|
|
|
|
|
Try like this in Button click event
protected void Button1_Click(object sender, EventArgs e)
{
for (int i = 0; i <= GridView1.Rows.Count;i++ )
{
Label box1 = (Label)GridView1.Rows[i].Cells[1].FindControl("label1");
Label box2 = (Label)GridView1.Rows[i].Cells[2].FindControl("label2");
}
}
You have to learn to think like a computer or teach him to think like a human...
----Kornfeld Eliyahu Peter
|
|
|
|
|
Hi,
I have developed a ASP.net Website (Razor 2) in VS 2012. I have a class which sent mail using System.Web.Helpers.WebMail.Send() method. This method has 13 Parameters and it works fine locally.
After uploading the same project on TFS 2012 it gives exception stating too many arguments for System.Web.Helpers.WebMail.Send() method.
Below is the Snippet of code which works fine before adding to TFS 2012
WebMail.Send(EmailTo, MailHeader, MailBody, EmailFrom, , , False, , "abc@gmail.com", , , , )
Error after adding on TFS 2012
Too many arguments to 'Public Shared Sub Send(to As String, subject As String, body As String, [from As String = Nothing], [cc As String = Nothing], [filesToAttach As System.Collections.Generic.IEnumerable(Of String) = Nothing], [isBodyHtml As Boolean = True], [additionalHeaders As System.Collections.Generic.IEnumerable(Of String) = Nothing])'
Regards.
Thanks.
|
|
|
|
|
trevor15 wrote: Too many arguments Is that message not clear enough? The Send method takes upto 8 arguments, and how many arguments do you pass? More than 10.
|
|
|
|
|
System.Web.Helpers.WebMail.send takes 13 parameters.
'Declaration
Public Shared Sub Send ( _
to As String, _
subject As String, _
body As String, _
from As String, _
cc As String, _
filesToAttach As IEnumerable(Of String), _
isBodyHtml As Boolean, _
additionalHeaders As IEnumerable(Of String), _
bcc As String, _
contentEncoding As String, _
headerEncoding As String, _
priority As String, _
replyTo As String _
)
If the project if built outside TFS den it work fine without errors.
|
|
|
|
|
I am designing a webpage to show all data after scrolling auto. I choose datagrid to show data but I do not know how to scroll all rows of datagrid that freezes it's header (scrolling from down to up like marquee tag in HTML).Please give me some advices
|
|
|
|
|
You can refer to this[^] for it.
.AK.
|
|
|
|
|
Thanks for your replying. Maybe, you misunderstood my idea. It mean that I want to insert "<marquee>" tag into Datagrid to running auto all rows following up to. Please help me, thanks a lot.
|
|
|
|
|
Hi all,
This problem is coming at an ugly time.
The app goes LIVE in 3.5 hours and here I am having issues.
We have two tables.
One table has username and password
The other table has username and password.
Problem is that username for one table is different from username from another table.
According to users, this was designed intentionally.
So, when a user attempts to log in, the code is supposed to check one table for existence of user's info. If not there, check another table.
This code is failing me.
Can someone please help?
Thanks alot in advance
MySQL = "select COUNT(*) from employees e " & _
"left join members r " & _
"on e.ssn = r.ssn WHERE (e.empl_login='" & txtUser.Text & "' AND e.empl_ssn = '" & txtPassword.Text & "') or (r.empl_login='" & txtUser.Text & "' AND r.empl_ssn = '" & txtPassword.Text & "')"
|
|
|
|
|
Firstly, what has this got to do with ASP.NET? It looks like a database question to me.
Secondly, if that's what your code looks like, then going live today is not an option. You urgently need to learn about SQL Injection[^], and then fix this major vulnerability in your code.
Thirdly, based on your query, it looks like you're storing passwords in plain-text. That is a very bad idea; you should be storing salted password hashes instead. See Salted Password Hashing - Doing it Right[^] for more details.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I tried with your query. it's working fine for me.
Table Structure
CREATE TABLE [dbo].[employees] (
[Id] INT NOT NULL,
[username] NVARCHAR (50) NULL,
[ssn] NCHAR (10) NULL,
[password] NCHAR (10) NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
CREATE TABLE [dbo].[members] (
[Id] INT NOT NULL,
[username] NVARCHAR (50) NULL,
[ssn] NCHAR (10) NULL,
[password] NVARCHAR (50) NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
Data
Members Table
INSERT INTO [dbo].[members] ([Id], [username], [ssn], [password]) VALUES (1, N'name3', N'123456700 ', N'pass3')
INSERT INTO [dbo].[members] ([Id], [username], [ssn], [password]) VALUES (2, N'nameOne', N'123456789 ', N'passOne')
INSERT INTO [dbo].[members] ([Id], [username], [ssn], [password]) VALUES (3, N'nameTwo', N'987654321 ', N'passTwo')
Employees Table
INSERT INTO [dbo].[employees] ([Id], [username], [ssn], [password]) VALUES (1, N'name1', N'123456789 ', N'pass1 ')
INSERT INTO [dbo].[employees] ([Id], [username], [ssn], [password]) VALUES (2, N'name2', N'987654321 ', N'pass2 ')
SQL
SELECT count(*)
FROM employees e JOIN members r ON e.ssn = r.ssn
WHERE (e.username='name1' AND e.ssn = '123456789')
OR (r.username='name1' AND r.ssn = '123456789')
If possible can you share your table data and structure ?
|
|
|
|
|
Arun Radhakrishnan wrote: If possible can you share your table data and structure ?
... and the link to your app
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
Hello,
Please let me know why we lost the session in our web application after exception, notice that all the code contains try-catch block.
Thank you
|
|
|
|
|
check the timeout value of sessionstate in your web.config. May be you have given very less. Session variable doesn't depend on try catch. Its only used to handle errors.
In addition sessions will not work locally or on the server unless you are running https (note the S on the end of https), if you have the following in your web.config file:
<httpcookies httponlycookies="true" requiressl="true">
|
|
|
|
|
kaushikpathak wrote: In addition sessions will not work locally or on the server unless you are
running https (note the S on the end of https),
I'm sorry, but that is just absolute cobblers....nonsense
C# has already designed away most of the tedium of C++.
|
|
|
|
|