title: Using a View from SQL Server 2008 in C# & Asp.net
body: <p>I have a C#/ASP.net project has included a database that I have developed that includes a nice and convenient View that would be handy to use.</p>
  
  <p>I have the SQL connection setup to a SQL Server 2008 DB I created.  It seems as though it is connecting fine, but I don't understand how to actually use the View that I created without hard coding the query into the program (been told this is bad sometimes?).  </p>
  
  <p>This is my connection I setup:</p>
  
  <pre><code>    SqlConnection conn = null;
      conn = new SqlConnection("Data Source=raven\\sqlexpress;Initial Catalog=ucs;Integrated Security=True;Pooling=False");
      conn.Open(); 
      SqlCommand command = new SqlCommand(query, conn);
  </code></pre>
  
  <p>Basically, I need some code to query using this View.  I can see the View and look at the results that would be obtained, but not access it in the program!
  The view is named "UserView". Help is much appreciated!</p>