处理数据库空值

问题描述:

嗨 我正在使用ListView控件来显示产品信息的摘要.

我添加了代码,以在使用单击ListView中的产品时填充的单独的组框控件中显示产品详细信息.并非组"框中的所有字段都适用于所有产品,因此某些字段在数据库中将始终为空.在ListView中单击产品时,将引发错误.

有没有可以解决的问题.任何帮助将不胜感激
感谢

Hi I am using a ListView control to display a summary of product information.

I have added code to display product details in a seperate group box control that is populated when the using clicks on a product in the ListView. Not all fields in the Group box are applicable to all products so that some fields will always be null in the db. This throws an error when clicking on the product in the ListView.

Is there away that this can be resolved. Any help would be appreciated
Thanks

用户单击ListView时,请检查详细信息是否为null.如果它们不为null,则不要填充组框.
When the user clicks on the ListView, check the details for a null. If they are not null, don''t populate the group box.


在查询数据库时尝试用一些值替换null
Try to replace null with some value in when you query database