title: Executing Shrink on SQL Server database using command from linq-to-sql
body: <p>I'm looking for a way to clear transaction logs; in particular, I want to shrink the logs. I know there are bad reasons for wanting to do it but in this instance, it's for a good reason.</p>
  
  <p>I've run this in SQL Server Management:</p>
  
  <pre><code>DBCC SHRINKFILE(DBName_log)
  DBCC SHRINKFILE(DBName)
  </code></pre>
  
  <p>That does what I need. Now I want to execute this command from code using Linq-To-SQL, something like this:</p>
  
  <pre><code>using (MyDC TheDC = new MyDC())
  {
     TheDC.ExecuteCommand(....);
  }
  </code></pre>
  
  <p>What command do I need to send to get both these actions executed in the database?</p>