依风居
===========================================================
判断table列的数据类型
===========================================================

当需要判断table某列的数据类型为double或int时则执行某些操作,语句如下:


if ((typeof(double).Equals(ds.Tables[0].Columns[dataGridView1.CurrentCell.ColumnIndex].DataType) == true)||
(typeof(int).Equals(ds.Tables[0].Columns[dataGridView1.CurrentCell.ColumnIndex].DataType) == true))

{

//某些操作语句

}

该语句若放在DataGridView的clickCell事件里面,则实现点击某个Cell则获取相应table的数据类型,若是int或double型则执行某些操作语句。

ebreezee 发表于:2008.05.02 19:59 ::分类: ( C# ) ::阅读:(128次) :: 评论 (0)

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)

 authimage


自我介绍
切换风格
新闻聚合
博客日历
文章归档...
最新发表...
最新评论...
最多阅读文章...
博客统计...
Blog信息
网站链接...