0

I'm following the ASP MVC Tutorial https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/introduction/getting-started The code below is taken from my controller:

    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Create([Bind(Include = 
    "UserID,UserName,Name,NoOfLogs,timestamps")] User user)
    {
        if (ModelState.IsValid)
        {
            db.loggers.Add(user);
            db.SaveChanges();
            return RedirectToAction("Index");
        }

        return View(user);
    }

My connection String in the web config looks like this:

  <connectionStrings><add name="DatabaseConnectionString"    
  connectionString="Server=.;
  database=dolly;uid=dol;pwd=dol;Pooling=true;Max Pool Size=100;Min Pool 
  Size=4;Network Library=dbmssocn;Application Name=dollymvc;" 
  providerName="System.Data.SqlClient" />
   </connectionStrings> 

However I received the exception (mentioned in the headline) as another part of the system using Glimpse for DB connectivity. Is there any workaround for this? A way to cast the glimpse to SQL? It is an ASP .NET MVC5 application I see that the question was asked 4 years ago without an approved answer. Uninstalling Glipmse in not an option Unable to cast object of type 'Glimpse.Ado.AlternateType.GlimpseDbConnection' to type 'System.Data.SqlClient.SqlConnection'

dolly_do
  • 97
  • 3
  • 3
  • 15
  • You really haven't provided enough information for us (e.g.: full stack trace, definition of `db`, etc.) My guess however would be that the `Network Library=dbmssocn` is throwing Entity Framework off. – Ian Kemp Jan 22 '19 at 11:10
  • It appeared that I was able to fix the error in the DB connection as you may see above. However now it is conflicting with Glimpse DB connection and I need to work it around. – dolly_do Jan 22 '19 at 11:59

0 Answers0