Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Paulo J Afonso

@Paulo J Afonso
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • PostBack data lost ASP.NET 4.5
    P Paulo J Afonso

    ;) ;) Thank is a great tips. :thumbsup: But if we need to use session, because the InValues can be different by users, so in that case we had to change to session. Can you send any link for how to change the cache to session, can you advice that change? :-\ Regards

    Paulo Afonso Windwater Technologies & Solutions

    C# csharp html asp-net database linq

  • PostBack data lost ASP.NET 4.5
    P Paulo J Afonso

    Hi All we are newbies on ASP and .NET, but with some experience on C# :-D. We need some explanation about what we are doing wrong in this code and HTML page. HTML Page

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GraficosDados.aspx.cs" Inherits="Testing_Studies_GraficosDados" %>

    <%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    </head>
    <body>
    <form id="form1" runat="server">

    </form>
    

    </body>
    </html>

    C# Code

    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.DataVisualization.Charting;
    using System.Data;

    using Windwater;

    public partial class Testing_Studies_GraficosDados : System.Web.UI.Page
    {
    Chart C1 = new Chart();
    System.Web.UI.WebControls.CheckBoxList cbLengend = new CheckBoxList();
    SQLHelper SQL = new SQLHelper();
    IOHelper Log = new IOHelper();
    DataTable dt = new DataTable();

    protected void Page\_Load(object sender, EventArgs e)
    {
        LoadTable();
    }
    
    private void LoadTable() 
    {
        if (!IsPostBack)
        {
            string\[\] InValues = new string\[\] { "2013-08-26 00:00", "2013-08-28 23:59", "2", "50" };
    
            Log.OnInfo(string.Format("Begin={0}\\tEnd={1}\\tTT\_Id={2}\\tpggrel\_id={3}", InValues\[0\], InValues\[1\], InValues\[2\], InValues\[3\]));
            dt = SQL.execStroredProcedures("EAPMSDAT", "wwGetDataForGraph", InValues);
            PopulateChart();
        }
    
    }
    
    private void PopulateChart()
    {
        string\[\] x = new string\[dt.Rows.Count\];
        double\[\]\[\] y = new double\[dt.Columns.Count\]\[\];
    
        for (int z = 1; z < dt.Columns.Count; z++)
        {
            y\[z\] = new double\[dt.Rows.Count\];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (z == 1)
                    x\[i\] = dt.Rows\[i\]\[0\].ToString();
                y\[z\]\[i\] = Convert.ToDouble(dt.Rows\[i\]\[z\]);
            }
            C1.Series.Add(dt.Columns\[z\].ToStr
    
    C# csharp html asp-net database linq
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups