DataSet case sensitive issue

今天系统进行了单元测试发现一个bug,不知道怎么回事。我们整个小组花费了半天时间终于找到了问题所在,就是:DataSet case sensitive

原以为在DataSet.Tables.Add(new DataTable(string strTableName))时,是可以随便的,没有想到就是这个东西发生了问题。google 了一下,发现这篇文章:
http://blogs.msdn.com/smartclientdata/archive/2005/10/07/478087.aspx  ( English )

突然大梦清醒,原来Dataset 也是 case sensitive (大小写敏感)的。查询MSDN 中关于 Dataset 的说明,有这么一段:
http://msdn2.microsoft.com/en-us/library/system.data.dataset.aspx

Whereas DataTable objects contain the data, the DataRelationCollection allows you to navigate though the table hierarchy. The tables are contained in a DataTableCollection accessed through the Tables property. When accessing DataTable objects, note that they are conditionally case sensitive. For example, if one DataTable is named "mydatatable" and another is named "Mydatatable", a string used to search for one of the tables is regarded as case sensitive. However, if "mydatatable" exists and "Mydatatable" does not, the search string is regarded as case insensitive. For more information about working with DataTable objects, see Creating a DataTable.

其它的先不管了,我就看到了对case  sensitive 的描述:

如果 DataSet 中包含名为 "mydatatable" 和另一个 "Mydatatable"时,在使用表查询时,Dataset 是大小写敏感的,如果只包含一个 "mydatatable" ,则又不是大小写敏感的。

看到这里,才发现原来是对DataSet 的标操作时出现了问题。更改后一切ok。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值