title: How to directly execute SQL query in C#?
body: <p>Ok, I have an old batch file that does exactly what I need.  However, with out new administration we can't run the batch file anymore so I need to start up with C#.</p>
  
  <p>I'm using Visual Studio C# and already have the forms set up for the application I need to build. (I'm learning as I go)</p>
  
  <p>Here is what I need to accomplish in C# (This is the batch guts)</p>
  
  <pre><code>sqlcmd.exe -S .\PDATA_SQLEXPRESS -U sa -P 2BeChanged! -d PDATA_SQLEXPRESS  -s ; -W -w 100 -Q "SELECT tPatCulIntPatIDPk, tPatSFirstname, tPatSName, tPatDBirthday  FROM  [dbo].[TPatientRaw] WHERE tPatSName = '%name%' "
  </code></pre>
  
  <p>Basically it uses <code>SQLCMD.exe</code> with the already existing datasource called <code>PDATA_SQLExpress</code>.<br>
  I've searched and gotten close but I'm still at a loss on where to start. </p>