Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9032559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:00:39+00:00 2026-06-16T08:00:39+00:00

I just solved my own question, but thought I’d might still be helpful for

  • 0

I just solved my own question, but thought I’d might still be helpful for others to read so decided to post it anyway.


I am trying to get started with azure development and am currently at the stage of getting the database up and running. After a few hickups I achieved the following:

  • installed VS2012, MSSQLSERVER2012, Azure SDK .NET, EntityFramework 6.0.0 alpha and a bunch of other things
  • wrote my first entities (code first) and generated a database out of it.

The last thing I’d like to see before I pick up the next challenge is to actually add something to my newly created database first. I’d thought the easiest way would be writing a test in nunit.

Here’s what I got so far…

The entity class User:

namespace Models.Users
{
    public class User
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string EmailAddress { get; set; }
    }
}

The entity class UsersDb:

using System.Data.Entity;

namespace Models.Users
{
    public class UsersDb : DbContext
    {
         public DbSet<User> Users { get; set; }
    }
}

Generated the database with the following PS commands:

enable-migrations -ProjectName Models -ContextTypeName Models.Users.UsersDb
add-migration -ProjectName Models Initial
update-database -ProjectName Models 

Finally, I wrote the following unit test

using Models.Users;
using NUnit.Framework;

namespace Tests
{
    [TestFixture]
    public class DatabaseTests
    {
        [Test]
        public void AddUserTest()
        {
            var users = new UsersDb();
            var user = new User
                {
                    Id = 1, 
                    Name = "test", 
                    EmailAddress = "test@gmail.com"
                };

            users.Users.Add(user);
            users.SaveChanges();
        }
    }
}

That test runs, but throws an exception I can’t figure out.

System.InvalidOperationException : The Entity Framework provider type ‘System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ for the ‘System.Data.SqlClient’ ADO.NET provider could not be loaded. Make sure the provider assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

Solution

What I had to do to solve this, is open NuGet management (right click solution) and press the manage button on EntityFramework. In the dialog add a checkbox in front of your test solution, rebuild and go.

Now, I have a very small solution that creates a new user via a unit test and saves it into my database. A nice startup project which I can now start extending.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:00:40+00:00Added an answer on June 16, 2026 at 8:00 am

    Solved the question while typing the question itself. Thought i’d still be useful as a reference for others.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: This question is solved, but I can't accept my own answer just yet.
This is not really a question because I just solved the problem, but I
this question might be very noobish but I'm just not able to find a
SOLVED MY OWN QUESTION! THANKS EVERYONE FOR THE HELP :) Ok. I'm having trouble
I just read this question and this question , and since then I have
I just solved a problem I was having putting the Set keyword in a
I just solved the first problem from Project Euler in JavaFX for the fun
I have solved this problem, I just need to know what to do. I
UPDATE: SOLVED Hi all, i've got it, just save cookie to temp file, and
I just saw this topic: Datatable vs Dataset but it didn't solve my doubt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.