private NORTHWINDDataContext _Context = new NORTHWINDDataContext(); private decimal[] GetPricesByEmployeeId(int employeeId) { decimal[] result = null; result = _Context.Orders.Where(o => o.EmployeeID == employeeId).Take(5) .Select(oo => (decimal)oo.ShipVia).ToArray(); return result; }
public JsonResult LoadData (string name) { var data = (from e in _Context.Employees.Take(10).ToList() select new { EmployeeID = e.EmployeeID, Orders = GetPricesByEmployeeId(e.EmployeeID), Name = e.FirstName, }).Distinct();
if (!string.IsNullOrEmpty(name)) { data = data.Where(d => d.Name.IndexOf(name) >= 0); }
Notes To display the html standard of the JQUBAR plug-in page, please use , MVC2.0 The C# code uses the NORTHWIND database. The JQUBar1.1 plug-in is heredownload.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn