title: Configure ASP.NET MVC 4 Application with Oracle Database
body: <p>I am currently working on ASP.NET MVC 4 project with Oracle database. I have successfully add the connection string in my Web.config file like here:</p>
  
  <pre><code>&lt;add name="OracleDBConnString" connectionString="Provider=MSDAORA;Data Source=ISDQA;User ID=isd;Password=isdqa;" providerName="System.Data.OleDB" /&gt;
  </code></pre>
  
  <p>But when I create a new project, it has already have a built-in authentication classes. How can I modify these classes once and for all? <strong>I want to change the default <code>ConnString</code></strong>.</p>
  
  <p>Here's my model:</p>
  
  <pre><code>public class UsersContext : DbContext
  {
      public UsersContext()
          : base("OracleDBConnString")
      {
      }
  
      public DbSet&lt;UserProfile&gt; UserProfiles { get; set; }
  }
  
  public class LoginModel
  {
      [Required]
      [Display(Name = "User name")]
      public string UserName { get; set; }
  
      [Required]
      [DataType(DataType.Password)]
      [Display(Name = "Password")]
      public string Password { get; set; }
  
      [Display(Name = "Remember me?")]
      public bool RememberMe { get; set; }
  }
  </code></pre>
  
  <p>Here's my User controller:</p>
  
  <pre><code>[HttpPost]
  [AllowAnonymous]
  [ValidateAntiForgeryToken]
  public ActionResult Login(LoginModel model, string returnUrl)
  {
      //I WANT TO MODIFY THIS PART
      if (ModelState.IsValid &amp;&amp; WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) 
      {
  
          return RedirectToLocal(returnUrl);
      }
  
      // If we got this far, something failed, redisplay form
      ModelState.AddModelError("", "The user name or password provided is incorrect.");
      return View(model);
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>When I change the <code>base("DefaultConnection")</code> to <code>base("OracleDBConnString")</code>, I got this error:</p>
  
  <pre><code>Server Error in '/' Application.
  
  A null was returned after calling the 'get_ProviderFactory' method on a store provider instance of type 'System.Data.OleDb.OleDbConnection'. The store provider might not be functioning correctly.
  </code></pre>
  
  <p>Note that I already added <code>using System.Data.OleDb;</code> on my usings.</p>