0

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 :)

brian4342
  • 1,265
  • 8
  • 33
  • 69
  • 1
    I find this article very helpful for a n-layered .net 2.0 architecture (also containing dal): http://imar.spaanjaars.com/416/building-layered-web-applications-with-microsoft-aspnet-20-part-1 – MUG4N Oct 15 '13 at 09:40

3 Answers3

1

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/

Rajesh Subramanian
  • 6,400
  • 5
  • 29
  • 42
0

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#

Warty
  • 7,237
  • 1
  • 31
  • 49
  • 3
    That would make a nice comment. – juergen d Oct 15 '13 at 09:39
  • It's hard to really give any advice without more details. If you want a general direction then Google's usually the way to go, and from my experience, a ton of programmers don't realize that. – Warty Oct 15 '13 at 09:54
  • Thanks for your help, any chance you could show your opinion to my additional comment? – brian4342 Oct 15 '13 at 10:37
  • It varies between projects. A DAL just simplifies the way you work with DBs. Instead of typing "insert blah into blah" queries all over your project, you can abstract your database and have methods such as AddUser(user). – Warty Oct 15 '13 at 19:46
-1

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.

druss
  • 1,820
  • 19
  • 18