资源简介
只需要一条SQL语句,即可完美展现动态统计图(柱状图、饼状图、3D柱状图等等),本实例是ASP.NET + SQLServer的,把解压后放到同一个目录,然后发布至IIS即可测试,有任何问题留言我

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using WebChart;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.xml;
using System.IO;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender EventArgs e)
{
getData();
//Button4();
// btn2();
}
//获取数据
protected DataSet getData()
{
DataSet ds = new DataSet();
try
{
string connectionString = “Data Source=.;Initial Catalog=ERP_OA; Persist Security Info=True;User ID=sa;Password=123456“;
SqlConnection con = new SqlConnection(connectionString);
con.Open();
//把xml中name显示的的数据列添加别名为name,value显示的数据列添加别名为value
string cmdstring = “SELECT bumenname as nameid as value from erpbumen where id <20 for xml autotype“;
SqlCommand cmd = new SqlCommand(cmdstring con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds);
string a = ds.Getxml().ToString();
a = a.Replace(“erpbumen““set“);
con.Close();
a = a.Replace(“l version=\“1.0\“?>“““);
a = a.Replace(““ ““);
a = a.Replace(“ “ ““);
a = a.Replace(““ ““);
a = a.Replace(“
“ ““);
a = a.Replace(““ ““);
a = a.Replace(“ “ ““);
a = “l version=\“1.0\“ encoding=\“utf-8\“?>“ + a + “ “;
a = a.Replace(“<“ “<“);
a = a.Replace(“>““>“);
xmlDocument xmldoc = new xmlDocument(); //创建空的xml文档
xmldoc.Loadxml(a);
xmldoc.Save(Server.MapPath(“Data.xml“)); //保存
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
return ds;
}
//gridview数据绑定
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1119 2015-09-11 10:36 Default3.aspx
文件 2350 2015-09-11 10:53 Default3.aspx.cs
文件 374 2015-09-11 10:37 Data.xm
----------- --------- ---------- ----- ----
3843 3
- 上一篇:C#上位机串口通信助手源代码
- 下一篇:通过修改属性表完成shp文件的修改
相关资源
- 020ASP.NET车辆综合管理系统.zip
- c# 高校档案信息管理系统
- asp.net中c#做的躲避小游戏,希望大家
- ASP.NET C# 工资管理系统
- ASP.NET客户管理系统(毕业设计 C#
- 在线求职系统(C#ASP.NET源码)
- asp.net 在线考试系统及论文
- ASP.Net文件上传管理源码
- 《OA企业办公自动化》asp.net 源码(附
- 数据表转实体源码(实体类生成器)
- asp.netc#开发规范
- asp.net 大文件上传(带进度条)
- 通过程序自动填充并提交ASP.NET表单(
- ASP.NET 基础编程文档(PPT电子教案)
-
ASP.NET_xm
l深入编程技术 - asp.net 新闻发布系统源码(附文档以及
- asp.net 简单的Ajax应用
- asp.net 企业官网源码(附数据库)
- asp.net 花语花店销售网站源码(含数据
- ASP.NET资产管理系统源码(附数据库)
- ajax 登录(基于asp.net)
- asp.net 简单新闻发布系统源码(附数据
- asp.net新闻发布系统(源码+数据库+论
- asp.net网上购物系统源码
- ASP.NET 在浏览器中预览文件
- asp.net 生命周期
- asp.net 花语花店销售网站源码(附数据
- asp.net 购物车实现(基于Session)
- C# asp.net验证码
- asp.net 网上商城源码
评论
共有 条评论