title: DataContext in static class in desktop application
body: <p>i am using 3 tier architecture in my winform application so i have static class which handle the operation of equipment </p>
  
  <pre><code> public static class Equipments 
  {
  
  
      public static void AddEquipment(string name, decimal dimLength)
      {
  
              DBClassesDataContext db = new DBClassesDataContext();
  
              Equipment equipment = new Equipment();
              equipment.Name = name;
              equipment.DimLength = dimLength;
  
              db.Equipments.InsertOnSubmit(equipment);
              db.SubmitChanges();
  
      }
  
  
  
    public static void UpdateEquipment(int equipmentID, string name, decimal dimLength)
          {
                           DBClassesDataContext db = new DBClassesDataContext();
  
                  Equipment oldEquipment;
                  oldEquipment = db.Equipments.Where("EquipmentID = @0",equipmentID).SingleOrDefault();
                  oldEquipment.Name = name;
                  oldEquipment.DimLength = dimLength;
  
                  db.SubmitChanges();}
  </code></pre>
  
  <p>so my questions are :</p>
  
  <ol>
  <li>Do i need to create instance of DBClassesDataContext  in each method ?<br>
  because when i done global static DBClassesDataContext it didn't work correctly.</li>
  <li>Is there any better way to handle DBClassesDataContext instead to create it each time inside the method (like create new DBClassesDataContext each time i run a method from this class)</li>
  </ol>
  
  <p>Thanks</p>