Pregunta

Ive been given the task of making a data access layer to connect to a sqlite database for a basic c# application. From what ive been told, I need to have 2 class files, 1 that holds the methods and one that connects to the database. However im not to sure where to start, any help would be appreciated.

Thanks in advance Brian

More -

From the links that you guys have provided it would appear that a data access layer is just a single class file with basic methods such as createDB, AddToDB, GetFromDB and other classes from the project just reference this class file and call those methods.

Is my assumpt above correct? if not i'd like your opinions on this :)

¿Fue útil?

Solución 2

I googled "Data Access Layer C#" and "C# sqlite dal" to get some helpful links:
Tutorial 1: Creating a Data Access Layer - MSDN - Microsoft
Easy Data Access Layer
A Basic SQLite DAL class in C#

Otros consejos

You can have look at the following links, it would be good to check alternatives,

https://code.google.com/p/dblinq2007/

https://github.com/praeclarum/sqlite-net

http://www.devart.com/dotconnect/sqlite/

When you create your DAL or before, you probaly want to write some Unit test for your DAL. Here is an article describe this proccess. how-to write unit tests for you Data Access Layer using in-memory database.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top