Advertisement
Guest User

Margus Martsepp (Stackoverflow:Removing non-unique data on insert)

a guest
Sep 20th, 2010
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1.         private void putWords(HashSet<string> words)
  2.         {
  3.             using (qWordlistDataContext lh = new qWordlistDataContext())
  4.             {
  5.                 foreach (string s in words)
  6.                     lh.words.InsertOnSubmit(new word() { word1 = s });
  7.  
  8.                 // Submit the change to the database.
  9.                 try
  10.                 {
  11.                     lh.SubmitChanges();
  12.                 }
  13.                 catch (Exception e)
  14.                 {
  15.                     Console.WriteLine(e);
  16.                 }
  17.             }
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement