Skip to main content

Posts

Showing posts from April, 2012

Learning C and or C++ on windows

If you want to start learning C/C++ and still want to use windows, you can either use Microsofts Managed C++ with a great IDE (Visual Studio) or GNU C/C++ compilers. Microsoft has invested a lot in C++ and Visual Studio. The powerful IDE really enhance the productivity. There is lot online documentation using which one can learn Microsoft's Managed C++ thick and fast. You can download Visual Studio Express for free and can start learning. Download Visual Studio 2010 express from here . Learning resources . If you want to learn GNU C / C++ you can start with downloading CodeBlocks. It is an IDE for GNU C / C++  and it comes bundled with the compiler which makes it really easy to install the compiler and avoid the complexities of getting the things in place pieces by pieces. You can download CodeBlocks from here .

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid

It was 2 o'clock at night when I was creating a model (MVC) using Entity Framework. I thought of creating a UnitTest project to follow some TDD. When I tried to run my first TestMethod I got this vague exception. After investigating further with half closed eyes I found out, how dumb I was to not to include App.config in the test project.  Basic concept is pretty straight forward and logical. We generally add entity framework to a class library project in order to be able to reuse the library. The library project is not an executable in its own. Thus we need to add this project in some executable say a console App, windows App, ASP.NET or UnitTest. The runtime will then expect the executable to have a config associated with itself which will have the connection string, which entity framework library is looking for. Thus, the solution is pretty simple. Add the app.config to the project you are trying to run or add connection string to the config if the project you are tryin