user1803354
user1803354

Reputation: 45

Connecting Web API to SQL server 2008

I am fairly new to .net MVC 4 and WEB API. I need to connect my web API to SQL server 2008 but I'm not sure how exactly. I'll I have seen is examples using the local DB and I can't seem to find my solution.

Upvotes: 3

Views: 13370

Answers (2)

Maggie Ying
Maggie Ying

Reputation: 10175

You might also want to check out this blog post by Jason Zander. He includes a very nice step-by-step walkthrough of building a simple Tourist Attraction Application: My Favorite Features: Entity Framework Code First and ASP.NET Web API.

LocalDB is just another engine that is used to access a SQL server database file .mdf -- just like SQLExpress. Visual Studio 2012 uses LocalDB by default while Visual Studio 2010 uses SQLExpress. Anyhow, you can just replace the connection string used in the tutorial with your actual database connection string.

Upvotes: 2

Maess
Maess

Reputation: 4146

The following tutorial shows how to create a Web API project and connect to a data source using Entity Framework: msdn

It should give you the gist of what needs to be done.

Upvotes: 0

Related Questions