Click here to Skip to main content
15,903,856 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
System.Data.DataViewManagerListItemTypeDescriptor

I am getting this error in combobox

and using this query

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


when there is no data its giving error how to remove it.
Posted
Updated 10-Aug-12 11:03am
v2
Comments
[no name] 10-Aug-12 16:53pm    
What error?
Wendelius 10-Aug-12 17:04pm    
Excellent question :)
fjdiewornncalwe 10-Aug-12 17:06pm    
:)
Anurag Sarkar 11-Aug-12 8:28am    
System.Data.DataViewManagerListItemTypeDescriptor
Anurag Sarkar 11-Aug-12 8:29am    
This is the error

1 solution

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.
 
Share this answer
 
Comments
Espen Harlinn 11-Aug-12 4:41am    
Good advice :-D
Wendelius 11-Aug-12 11:13am    
Thanks Espen :-)
Anurag Sarkar 11-Aug-12 8:30am    
Thanks for the advice Sir.
Wendelius 11-Aug-12 11:13am    
You're welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900