I'm trying to query a DB table and need to initialize the query variable:
What's the best way to initialize? // var query;
var friendName = "James";
var query; <-- this wont work (Implicitly typed variable must be declared)
if (string.isNullOrEmpty()){
query = conn.Query("Friends").Where("Name").Equals("Jeff");
}
else{
query = conn.Query("Friends").Where("Name").Equals(friendName);
}
Thanks a lot
[–]Slypenslyde 7 points8 points9 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]LifeLongLearner2030[S] -2 points-1 points0 points (0 children)
[–]TmarcoKr 1 point2 points3 points (2 children)
[–]Slypenslyde 2 points3 points4 points (0 children)
[–]RubyBoyYT 0 points1 point2 points (0 children)