Why is there no int overload for SqlFunctions.StringConvert

时间秒杀一切 提交于 2019-12-12 03:08:31

问题


Title pretty much sums it up. I'd bet that over half the usage of this method in the wild involves someone casting an int to a decimal or double in order to use it, so why isn't there just an overload that takes an int as the argument?

http://msdn.microsoft.com/en-us/library/system.data.objects.sqlclient.sqlfunctions.stringconvert.aspx


回答1:


Because it's directly related to the STR function found here:

http://msdn.microsoft.com/en-us/library/ms189527.aspx

and that function only takes a float, hence the parameters you're seeing.



来源:https://stackoverflow.com/questions/8806315/why-is-there-no-int-overload-for-sqlfunctions-stringconvert

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!