I assume SqlParameter.IsNullable only makes sense when…?

前提是你 提交于 2019-12-06 13:23:27

Ans : 1: When SqlParameter.IsNullable is set to true, received null value is converted to DBNull.Value and sent to database. Thus I would assume setting IsNullable to true only makes sense when GridView’s Parameter.ConvertEmptyStringToNull is also set to true? - simply yes

The responses in general are "NO" to all your questions, because not always there is a DataGrid, which is not the only way to show data and or get an input from the user.

If your user interface provides data in another way (e.g. DetailView, FromView, hand-made-window-or-page, etc...), or you have not UI at all, and your data come from another source, you may have to deal with IsNullable and/or ConvertEmptyStringToNull properties independently from a DataGrid that does not exists!

IsNullable in particular, when you are calling stored procedures, should match the sp's definition of the parameter.

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