| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 465 人关注过本帖
标题:导出SQL数据来计算
只看楼主 加入收藏
大头针
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2010-11-3
结帖率:75%
收藏
 问题点数:0 回复次数:0 
导出SQL数据来计算
Hi, here is my code. and it seems that the problem is the format of the output from the sql command. it is not float but a string or what. how can I fix this problem??? many thanks.


SqlConnection myConnection = new SqlConnection("user id=ABC; password=123; Trusted_Connection=yes; Data Source=ABCD\\SQLEXPRESS; Database=MyDb");            
           SqlCommand myCommand = new SqlCommand("SELECT Col1, Col2 FROM MyTable", myConnection);
           myConnection.Open();
           SqlDataReader myReader= null;            
           myReader = myCommand.ExecuteReader();
       while (myReader.Read())
           {
        Chart1.Series["Series1"].Points.AddY(myReader.GetFloat(0));
                Chart1.Series["Series2"].Points.AddY(myReader.GetFloat(1));
      }
搜索更多相关主题的帖子: sql password command problem 
2011-02-10 23:57
快速回复:导出SQL数据来计算
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020597 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved