N
Nime
For SQL queries, I want to use a code something like below:
SqlQuery query = new SqlQuery();
if(query("SELECT TOP 1 value FROM table").Error == 0) {value = query.Result;} else value = 0;
//Here, I execute a method then assign a property, at the same time.
I created a simpe SQL query class and now I simply do that:
if(query.ExecuteError(sql) == 0) {value = query.Result;}
else { value = 0; error = query.Error;}
I wonder can I do that, simply run a method and assign an inner property:
error = query.Execute(sql).Error;
SqlQuery query = new SqlQuery();
if(query("SELECT TOP 1 value FROM table").Error == 0) {value = query.Result;} else value = 0;
//Here, I execute a method then assign a property, at the same time.
I created a simpe SQL query class and now I simply do that:
if(query.ExecuteError(sql) == 0) {value = query.Result;}
else { value = 0; error = query.Error;}
I wonder can I do that, simply run a method and assign an inner property:
error = query.Execute(sql).Error;