我的SQL C#组合框数据绑定 [英] My Sql c# Combo box data binding

查看:151
本文介绍了我的SQL C#组合框数据绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Data.DataViewManagerListItemTypeDescriptor

我在combobox中遇到此错误

并使用此查询

System.Data.DataViewManagerListItemTypeDescriptor

I am getting this error in combobox

and using this query

select * from empdependents where pfno="  " and (relation='Daughter' or relation='Son')





when there is no data its giving error how to remove it.

推荐答案

根据您提供的描述,SQL查询从不返回一个如果未返回任何记录,则会发生错误,因为那是完全好的情况.

因此,如果您的查询未得到任何结果时您的代码引发错误,则我不会从查询中搜索问题(从逻辑上讲,没有找到满足条件的记录是可以的),而是使用结果.

您希望在代码中的某个位置上,结果集中总是有行.

希望这会有所帮助.
Based on the description you have provided, SQL query never returns an error if no records are returned, because that''s a perfectly fine situation.

So if your code raises an error when you get no results from your query, I wouldn''t search the problem from the query (taken that it is logically okay not to find any records satisfying the criteria) but search from the code using the results.

Most likely somewhere in your code you ecpect to always have rows in the result set.

Hope this helps.


这篇关于我的SQL C#组合框数据绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆