title: Connect to Oracle with MVC 3 Query and Display Data
body: <p>I am supposed to create a MVC 3 Page (using Telerik).<br>
  I created the application before in C# .aspx 4.0 and worked just fine but my company would prefer to have it as a MVC page. </p>
  
  <p>I never used MVC but I think I got the general hang of it; however, I seem to fail on the simplest step.</p>
  
  <p>I want to connect to an oracle database, query the database and finally display the Data in a Grid. I do not understand how to connect to the database. (I read through approx. 50 Tutorials and couldn't find anything helping me here)</p>
  
  <p>In the webform I would write something like this in the Code behind:</p>
  
  <pre><code>OleDBConnection dbConnection = new OleDbConnection();
  dbConnection.ConnectionString = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
  dbConnection.Open();
  
  OleDbCommand dbCommand = new OleDbCommand();
  dbCommand.CommandText = "select * from table where id &gt; 500";
  </code></pre>
  
  <p>And so on. Then write the Data into a DataTable for Example.</p>
  
  <p>So to my question: How would i do this in MVC? I understand that I would put that somewhere in the Model but that is all that I got so far.</p>
  
  <hr>
  
  <p>For further discussion:</p>
  
  <p>Part of the Menu:</p>
  
  <pre><code>...
  .Items(item =&gt;
  {
  item.Add().Text("Run Table Statistics").Action("Standard", "TableStatistics");
  ...
  </code></pre>
  
  <p>Now I would create a Folder DLA and add a new class to it:</p>
  
  <pre><code>public static IList&lt;Tiles&gt; GetTiles()
  {
     //Write code to get data from your favorite db.(Oracle/SQLServer/..?) 
     //All you want to do is return a list of customer objects
  }
  </code></pre>
  
  <p>&lt;- What do you mean by Objects? How could I retrieve objects? I was going to read through the database and add it to a DataTable or similiar.</p>
  
  <p>Now I would create an empty Controller called "TableStatisticsController.cs"
  where I put this:</p>
  
  <pre><code>public ViewResult Standard()
  {
    Object Tiles=**YourDataAccessClass**.GetTiles().ToList();
    return View(Tiles);
  }
  </code></pre>
  
  <p>What do you mean by YourDataAccessClass would that be the Class I created in DLA?</p>
  
  <p>You said in my strongly typed view? I would like to use Telerik Grid View, is that possible?</p>