I constantly find that I am writing similar code, as in the example below:
if (object["Object Name"] != null) {
if (object["Object Name"] == "Some Value") {
} else {
}
} else {
}
The problem is that I checked a lot whether the object is null or not, and then I can check it for the actual contents.
Statement B is always the same, and in my case it is usually an SQL statement.
Should there be a better way around this?
Thanks
Steven
source
share