惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
B
Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News
U
Unit 42
雷峰网
雷峰网
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
美团技术团队
Y
Y Combinator Blog
腾讯CDC
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements

博客园 - 戴玮

关于状态模式的思考 实在是忍受不了MSN的巨慢速度,重新换个地方 如果在网页中实现查找功能 asp.net2.0 页面生命周期方法 C#加密与解决 如何自定义一个模板列,并在后台加载 ASP.NET常用的代码集合 - 戴玮 - 博客园 触发器示例代码 ADO.NET2.0分页 - 戴玮 - 博客园 如何查找 Office Web 组件 (OWC) 编程文档和示例 如何将枚举定义翻译成DataTable 网页中调用MSN添加好友工具 如何在XP SP2下面使用DTC Javascript 复制与粘贴 - 戴玮 - 博客园 如何在Component中取得Page对象 使用TransactionScope进行COM+事务处理 - 戴玮 - 博客园 巨NB的JAVASCRIPT代码 - 戴玮 - 博客园 9月25日C#->WebService中如何传递文件 解决了一年多的问题,狂喜(一年之前)
如何在C#中使用EVAL方法 - 戴玮 - 博客园
戴玮 · 2006-11-15 · via 博客园 - 戴玮

   decimal a  = 1;
   decimal b = 2;
   string ev  = "a + b";
   System.Data.DataTable dt = new System.Data.DataTable();
   dt.Columns.Add("a",typeof(decimal));
   dt.Columns.Add("b",typeof(decimal));

   dt.Rows.Add(new object[]{a,b});
   dt.Columns.Add("c",typeof(decimal));
   dt.Columns["c"].Expression = ev;
   MessageBox.Show(dt.Rows[0]["c"].ToString());

谢谢山西的马泽KUI,给了我良好的想法!

posted on 2006-11-15 12:28  戴玮  阅读(1400)  评论(2)    收藏  举报