Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- public partial class _11 : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- DataClassesDataContext db = new DataClassesDataContext();
- var qry = from emp in db.Employees
- join dat in db.Customers on emp.City equals dat.City
- select new {FirstName = emp.FirstName,
- LastName = emp.LastName,
- CompanyName = dat.CompanyName,
- ContactName = dat.ContactName
- };
- GridView1.DataSource = qry;
- GridView1.DataBind();
- }
- /*
- * Mediante el uso de la clausula join seleccione los campos LastName y
- FirstName de la tabla Employees y los campos ContactName y
- Company Name que sean de la misma ciudad (City). Muestre los
- resultados en un GridView.
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement