Hi all:
for example:
testDataContext db=new testDataContext();
var res=db.tables.single(p=>p.columnName=="hi");
if there is a record in the database, it works well, but if there isn't , it will throw an exception, then , How could I know the record exists or not ? I don't think exception is a resonable way. and in my opinion, there should be--------even must be ------a resonable way , to evaluate the query result to a bool variable, then program could judge the bool variable like :
if(bExist)
show("yes, I find it");
else
show("sorry, the record doesn't exist in the database");
I can't imagine I got the bool variable via exception...
thanks to all..