Last post Feb 16, 2016 08:21 AM by Mikesdotnetting
Feb 11, 2016 05:04 AM|seerexis|LINK
i am a COMPLETE newbie to Asp.Net, and i just can't figure out how to get this to work.
I am trying to use the entity framework to scaffold some CRUD operations for my models. This i can do, and it generates the files. So far, so good.
When i try to access the index or any other file, it simply just breaks, saying i don't have a connection to an SQL server. This is obviously required, and i haven't configured this.
I downloaded SQL Server Express, but that didn't do anything. I think my issue is that i somehow have to connect my application to a certain localhost instance of the database, but i have absolutely no idea how to do it at all. All the tutorials i have watched
simply skips this step and just assumes you've done it before.
I hope you can help me. Been stuck at this for 2 days now.
Feb 11, 2016 07:07 AM|XIII|LINK
I downloaded SQL Server Express
Did you also install it and check if it's up and running?
Did you take a look at
Feb 11, 2016 11:28 AM|seerexis|LINK
Yea it seems to be up and running, but i don't know how i "connect" to it from my application.
I just can't believe it has to be so hard getting a simple database created? In PHP where i come from it is as easy as cake just using PHPMyAdmin, but in this ASP environment i am just completely lost.
I simply have no idea what to do. I just want to be able to make a model, create a controller for it, scaffold the code and test it out. I can do everything except the last part, since it can't connect to the database.
Really hope someone can guide me. I am using ASP 5 and MVC 6 btw.
Feb 15, 2016 09:52 AM|XIII|LINK
since it can't connect to the database
In your web.config there's a connectionStrings element in which you can place your connectionstring to your database. If you don't have it already or don't know the connectionstring you can, in Visual Studio, go to the Server Explorer pane, set up a connection
to the database and in the properties pane see the connectionstring. You can then copy paste that one over to your web.config if needed.
Feb 16, 2016 08:21 AM|Mikesdotnetting|LINK
I am using ASP 5 and MVC 6 btw.
ASP.NET 5 (now called ASP.NET Core) is not finished. It's a Beta product. Step down to MVC 5 because it is a more stable version, and then follow some of the basic tutorials that show how easy this actually is: https://www.asp.net/mvc/overview/getting-started/introduction/getting-started