private void FillAmCollection() { DbUser findUser = new DbUser(); findUser.Username = username; findUser.TypeId = 1; try { users = client.FindUser(findUser); if (users.Count > 0) { for (int i = 0; i < users.Count; i++) { if (users[i].Username == username) { //i++; } else { DbUser user = users[i]; _AMCollection.Add(new DbUser { FirstName = user.FirstName, LastName = user.LastName, Username = user.Username, Location = user.Location }); } } } } catch (Exception) { } }
protected void Page_Load(object sender, EventArgs e) { user.TypeId = 1; gvAccMan.DataSource = from f in service.FindUser(user) select new { f.FirstName, f.LastName, f.Email, f.Location }; gvAccMan.DataBind(); }