码迷,mamicode.com
首页 > 其他好文 > 详细

关于IDataReader.GetSchemaTable的一些事情

时间:2014-10-16 09:57:02      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:des   io   ar   sp   on   ad   ef   bs   sql   

The implementation of IDataReader.GetSchemaTable() is up to the provider - so it will vary. You can write your own providers and do it any way you want.

To be honest this is bad bit of design in the framework - you should never have interface methods that return an untyped DataTable or DataSet as that result could contain anything. Kinda defeats the point of constraining it by an interface in the first place: "you must have a method that returns DataTable but we don‘t care what rows or columns it has"

Even if the provider is SQL GetSchemaTable() doesn‘t go back to the [syscolumns] or [sysobjects]. That would be an additional DB call, require additional privileges and not work anyway, as the result set doesn‘t need to reflect any objects in the DB.

I‘m not certain, but I‘d expect the vast majority of IDataReader.GetSchemaTable() implementations to read some properties of the meta data held with the result set.

关于IDataReader.GetSchemaTable的一些事情

标签:des   io   ar   sp   on   ad   ef   bs   sql   

原文地址:http://www.cnblogs.com/s5689412/p/4027955.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!