CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

stufff

79 Views
Copy Code Show/Hide Line Numbers
   1:  using (EntityConnection conn = new EntityConnection("name=PayrollEntities"))
   2:  {
   3:      conn.Open();
   4:   
   5:      // Entity SQL
   6:      string sQueryString = "SELECT VALUE e FROM PayrollEntities.Employees AS e";
   7:   
   8:      using (EntityCommand comm = new EntityCommand(sQueryString, conn))
   9:      {
  10:          EntityDataReader reader = comm.ExecuteReader(CommandBehavior.SequentialAccess);
  11:   
  12:          while (reader.Read())
  13:          {
  14:              Console.WriteLine(reader["FirstName"]);
  15:          }
  16:      }
  17:   
  18:   
  19:  }
  20:   
  21:  Console.ReadLine();
by jaras
  May 18, 2010 @ 1:01pm

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate