Advertisement
Guest User

Untitled

a guest
Jun 20th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. String cstr = "User Id=snameche;Password=xxx;Host=localhost;Database=guce;Initial Schema=public";
  2. using (var connection = new PgSqlConnection(cstr))
  3. {
  4. using (var contex = new guceEntities(connection))
  5. {
  6. contex.user_groups.Add(new user_groups { username = "Hawaii" , grp_id=10});
  7. contex.SaveChanges();
  8. }
  9. using (var contex = new guceEntities(connection))
  10. {
  11. foreach (var destination in contex.user_groups)
  12. {
  13. Console.WriteLine(destination.username);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement