Invalid object name exception thrown for update

I have a project using Simple Repository that worked before I rebuilt my dev machine. This may just be a coincidence, but now I'm using SQL Server 2008 Express for development against, and not since 2005, and now when I start my project, I get the exception "Invalid object name" TableName ". The table exists because the records are inserted okay, but when it comes to updating the record that occurs when an exception is thrown.

In case this helps, this is an example code in which an error occurs:

    /// <summary>
    /// Updates the specified entity.   
    /// </summary>
    /// <param name="entity">The entity.</param>
    public void Update(IList<Result> entity)
    {
        using (TransactionScope ts = new TransactionScope())
        {
            using (SharedDbConnectionScope scs = new SharedDbConnectionScope())
            {
                foreach (Result result in entity)
                {
                    Update(result);
                }

                ts.Complete();
            }
        }
    }

    public void Update(Result entity)
    {
        repo.Update(entity);
    }
+3
source share

Source: https://habr.com/ru/post/1752672/


All Articles