Binky
Binky

Reputation: 31

Best way to setup the database connection for my ASP.NET app?

I'm a beginner with ASP.NET coming from a PHP background.

I'm planning on creating a database driven application but I was wondering after creating my DB structure using the free SQL Server Express, what is the best way to connect to my database?

I'm wondering if there's any tutorial on the best and most professional approach to do this. This would really help me a lot and get me started. Thank you in advance!

Upvotes: 1

Views: 1303

Answers (1)

DalSoft
DalSoft

Reputation: 11117

The best and most professional approach would be to use a ORM. My favourite ORM's for .NET are (in no particular order):

Fluent NHibernate - walkthrough

Dapper - stackoverflow examples question

Entity framework - Microsoft's own ORM

If your just starting out Dapper is great. You just run a SQL statement against a connection and Dapper takes care of mapping the results to a class for you. Dapper is used by stackoverflow BTW.

Upvotes: 1

Related Questions