c# - query on db print to console -
i want write query on db finds user name longer 4 char , print them , code goes:
also need alter kind of homecoming type list/array?
public string[] findnamebylength(int minimumcharnumber) { var query = u in db.users u.fullname.length > minimumcharnumber select u.fullname; string[] nameslength; int counter; foreach (var s in query) { nameslength.concat(new[] {s }); } homecoming nameslength; }
how add together each name array?
use length property check string length. seek :
public void findname() { var query = u in db.users u.fullname.length > 4 select u.fullname; foreach(var s in query) console.writeline(s); }
c# sql
No comments:
Post a Comment