Questions tagged [data-access-layer]

Data access layer is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database.

A data access layer (DAL) in computer software, is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database.

For example, the DAL might return a reference to an object (in terms of object-oriented programming) complete with its attributes instead of a row of fields from a database table. This allows the client (or user) modules to be created with a higher level of abstraction. This kind of model could be implemented by creating a class of data access methods that directly reference a corresponding set of database stored procedures. Another implementation could potentially retrieve or write records to or from a file system. The DAL hides this complexity of the underlying data store from the external world.

For example, instead of using commands such as insert, delete, and update to access a specific table in a database, a class and a few stored procedures could be created in the database. The procedures would be called from a method inside the class, which would return an object containing the requested values. Or, the insert, delete and update commands could be executed within simple functions like registeruser or loginuser stored within the data access layer.

Also, business logic methods from an application can be mapped to the Data Access Layer. So, for example, instead of making a query into a database to fetch all users from several tables the application can call a single method from a DAL which abstracts those database calls.

1287 questions
-1
votes
1 answer

Using a data access layer calling method on different page wont update database

I have a data access layer to update and trying to call method on different page wont update database i have tried moving some code around to be outside of the loop and also set a break point but the data doesn't reach the break point Data access…
amb101293
  • 5
  • 5
-1
votes
1 answer

howTo translate Web2Py SQL Code with ROW_NUM, LIMIT into DAL?

How is this (SQLite Code), working: csv_rt_bat_c_x = db.executesql('select * from csv_rt_bat_c LIMIT 100') converted into Web2Py DAL? Thats working: csv_rt_bat_c_x = db().select(db.csv_rt_bat_c.ALL) But how to add the 100 LIMIT (to speed it up…
klausz
  • 33
  • 6
-1
votes
1 answer

Error Passing parameters to Data Access Layer

I am passing a string to a DAL which is the Select Query with to parameters, first name and last name. The answer I keep getting is System.Data.SqlClient.SqlException: 'Must declare the scalar variable "@FirstName".' The request is for the 'DAL to…
Bill
  • 1
  • 2
-1
votes
1 answer

Structuring a Data Access Layer

For my application, I am looking at using an ORM and currently trying to decide if the domain layer should interface with it through a Data Access Object, Repositories, or something else? I am hesitant to pair an ORM with repositories because they…
-1
votes
1 answer

Populating a Combo Box with Data using a DAL

I am using a DAL and I am trying to populate a ComboBox with data from the DAL. I am aware of how to do this when I am connecting to the database directly from the GUI code, however I am trying to use Classes so that I do not need to reconnect to…
-1
votes
2 answers

Custom Database Connection Object: Should i use a general one (singleton) or one per object instance?

What is the best practice: To create just one single static class (Singleton) that provide all needed connection to the database or create one object per DAO instance? Note that my project access more than one database simultaneously, so i created a…
Ewerton
  • 4,046
  • 4
  • 30
  • 56
-1
votes
1 answer

Using a Data Access Layer in an OOP C# application using SQL

I have come from an environment where I was taught to use objects and employ OOP techniques where possible and I guess it has guided me down a particular road and influenced my product designs for quite some time. Typically my data access layer will…
user1169502
  • 368
  • 1
  • 5
  • 13
-1
votes
2 answers

Is it good way to inject a Service into DAO in java

I have a scenario where i need to call some service in the DAO layer to fetch some data based on a input coming from the database(in the resultset). so what best to way to instantiate the service. Inject in the DAO constructor or instanstiate inside…
Pradeep
  • 1,192
  • 2
  • 12
  • 30
-1
votes
2 answers

C# Winform - DAL and BLL - usage of static methods is good?

The doubt I am encountering is regarding the usage of static methods during the implementation of DAL and BLL access layer in a winform application. I know that there are many articles here regarding this topic but I didn't find any article which…
-1
votes
1 answer

Layered Design /Architecture

we use html 5/angular SPA with Webapi at the service which communicates with DAL for dataaccess operations Layer flow would be: presentation(html5/angular controllers/service) --> web api --> DAL - -> DB. we do not have BLL project as such. we are…
-1
votes
1 answer

Recommendations on passing data obtained from a data store to the business layer

I'm trying to develop a Data Access layer in .NET, C# to be specific, without the use on entity framework, just ADO.NET. In this case the data is coming from a database. I'd like to keep the data processing logic away from the Data store querying…
user2921909
  • 83
  • 2
  • 7
-1
votes
3 answers

Select where not exist in interval ? Different between four dates

In the first the business is car rental system . I want to get all car where has no orders in interval selected by user public List SearchCar(DateTime pickdate, DateTime dropdate) { var db = new CarRentalDBEntities(); var temp = new…
Issa Saman
  • 100
  • 9
-1
votes
1 answer

C# Entity Framework - Social Network - Friendship, Chat Entity

I am trying to do a database model for my social network school project. I am using Entity Framework 6. The problem is how should I model my Friendship and Chat entity. I get this error: Unhandled Exception: …
-1
votes
1 answer

Design pattern for mapping database in Data Access Layer [C#]

I work on my Data Access Layer where I use data mapper pattern. My actual structure of code is for example: public class Person { public int Age public string FirstName public string LastName public List
Addresses …
Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
-1
votes
1 answer

Generate Data Access Layer with t4 template

I am looking for some help or pointers explaining a bit more on generating the whole Data Access Layer with a T4 Template. For example all the INSERT etc. statements and C# methods implementing it.