title: Execute sql script on SQL server using C#
body: <p>SQL Server 2008 R2 Express, .Net Framework 4.0, Visual Studio 2010</p>
  
  <p>I'm trying to execute a SQL script from a command prompt application. I found a <a href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/43e8bc3a-1132-453b-b950-09427e970f31" rel="nofollow">sample</a><br>
  code and trying to implement the same. But the following using statements are not recognized. </p>
  
  <pre><code>using Microsoft.SqlServer.Management.Common;
  using Microsoft.SqlServer.Management.Smo;
  </code></pre>
  
  <p>Am I missing any assembly reference ?</p>