2
Answers

Check if Dataset is Null?

Ask a question
Janis Peksa

Janis Peksa

13y
1.5k
1
I have simple code, like this: http://paste.php.lv/9aad9c370b9104e5e42908c8db0f1356?lang=csharp

I have problem if I enter SELECT id2 FROM table and column id2 doesn't not exist it's shows me error:
http://uploadpic.org/storage/2011/KyrNTJB1zK8blk8WV17VwbLlt.png

So I tried many ways but nothing helps:
1) if (ds != null)
2) if ((ds != null) && (ds.Tables[0].Rows.Count != 0))

I searched it all around google so no help there.
Help me please.



Answers (2)
Next Recommended Forum