R – Strongly typed .net -> sql data access

data-access-layernetorm

I know what i want but not sure of the name and required tools so here goes…

I have a few different sql tables.

I want a tool that will generate an object in my .net project for each table, with each column a property of this object. (i.e. strongly typed, no datatables)

I want to be able to call select, insert, update and delete methods in my .net project and possibly pass an object (i.e. 'Person') to my insert() method that will insert it into the sql table.

Im not sure whether this is a data access layer, and object-relational mapping or linq to sql, or a mishmash of both.

Any advice appreciated.

Best Answer

LINQ to SQL, nHibernate, and any of a number of other ORMs will do all that you require. I believe that there is also LINQ to nHibernate if you want to go the ORM route. Personally, I've been ok with LINQ to SQL alone, using the LINQ to SQL Classes designer to generate my entities. I prefer using the IQueryable extension methods over the LINQ syntax, but that's more of a personal preference. You will need to use data context methods for insert and delete, though.