点滴积累【C#】---简单嵌套flash读取数据

效果:

说明:此效果只是简单的嵌套flash读取数据库中某两个字段的数据。(【js下载地址:http://163.fm/L6X8OAe  提取码:PRhkACbJ】 【swf下载地址:http://163.fm/Nqo2BPU   提取码:ot6Ws5zn 】    )

事件:初始化加载。

代码部分:

HTML:

 1 <html xmlns="http://www.w3.org/1999/xhtml">
 2 <head runat="server">
 3     <title></title>
 4     <script src="flash/FusionCharts.js"type="text/javascript"></script>
 5 </head>
 6 <body>
 7     <form id="form1" runat="server">
 8     <div>
 9         <table width="920" align="center" border="0" cellspacing="0" cellpadding="0" id="flash">
10             <tr>
11                 <td>
12                     <div id="flashGO" style="width: 900px; border: 1px #ccc solid;">
13                     </div>
14                 </td>
15             </tr>
16         </table>
17     </div>
18     </form>
19 
20     <script type="text/javascript">
21         getchart('flash/Column3D.swf');
22         function getchart(str) {
23             var chart = new FusionCharts(str, "ChartId", "900", "400");
24             chart.setDataXML('<?xml version="1.0" encoding="UTF-8" ?>'+
25             '<chart caption="青苹果数据分析"  bgColor="#ffffff" xAxisName="试验室检测项目" yAxisName="总条数"' +
26                 ' numberPrefix="" sformatNumberScale="1"  syncAxisLimits="10" rotateValues="0" showSum="0" baseFontSize="12">' +
27                 /***生成柱状图*************************************************/
28                        <%=flash %>
29             /************************************************************/
30                 '</chart>');
31             chart.render("flashGO");
32         }
33     </script>
34 
35 </body>
36 </html>

后台:

 1 namespace qiantaoflash
 2 {
 3     public partial class _Default : System.Web.UI.Page
 4     {
 5         SqlConnection con = new SqlConnection("server=NEWSPRING;database=QG_Mis;uid=sa;pwd=pass@word1");
 6         protected void Page_Load(object sender, EventArgs e)
 7         {
 8             GetData();
 9         }
10         public string flash = string.Empty;
11         protected void GetData()
12         {
13             string sql = string.Format(@"SELECT TOP 30 * FROM ly_tzk");
14             DataSet ds = new DataSet();
15             SqlDataAdapter sda = new SqlDataAdapter(sql, con);
16             sda.Fill(ds);
17             foreach (DataRow dr in ds.Tables[0].Rows)
18             {
19                 flash += "'<set label=" + '"' + dr["xmmc"].ToString() + '"' + "value=" + '"' + dr["MenuID"].ToString() + '"' + "/>'+";
20             }
21         }
22     }
23 }

 

 

转载于:https://www.cnblogs.com/xinchun/archive/2013/06/03/3116251.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值