Answers for "linq select if different null"

0

linq select if different null

db.UserAdresses.Where(p => p.UserID == guid && p.PostalCode != null)
Posted by: Guest on October-01-2020
0

linq select if different null

using (MyTestDBEntities context = new MyTestDBEntities())
            {
                var query = context.UserTables.Where(p => p.City != null)
                    .Select(cc => new { DisplayValue = cc.UserID, DisplayText = cc.FirstName + "  " + cc.LastName + "  " + cc.City });

                DropDownList1.DataSource = query.ToList();
                DropDownList1.DataTextField = "DisplayText";
                DropDownList1.DataValueField = "DisplayValue";
                DropDownList1.DataBind();
            }
Posted by: Guest on October-01-2020

Browse Popular Code Answers by Language