Ejemplo n.º 1
0
Archivo: Form1.cs Proyecto: akapet/MCPD
 private void simpleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var ctx = new NorthwindDataContext();
     var sw = new StringWriter();
     ctx.Log = sw;
     var employees = from emp in ctx.Employees
                     where emp.LastName.StartsWith("D")
                     select emp;
     dg.DataSource = employees;
     MessageBox.Show(sw.GetStringBuilder().ToString());
 }
Ejemplo n.º 2
0
Archivo: Form1.cs Proyecto: akapet/MCPD
 private void lazyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var ctx = new NorthwindDataContext();
     var sw = new StringWriter();
     ctx.Log = sw;
     var employee = (from emp in ctx.Employees
                     where emp.LastName.StartsWith("Davolio")
                     select emp).First();
     MessageBox.Show(sw.GetStringBuilder().ToString());
     sw = new StringWriter();
     ctx.Log = sw;
     employee.Photo.ToArray();
     //var photo = new MemoryStream(employee.Photo.ToArray());
     MessageBox.Show(sw.GetStringBuilder().ToString());
 }