data-access-layer

What is the difference between DAO and DAL?

Having studied Java at school I am quite familiar with the DAO-pattern(Data access object). However at work I use .NET. In .NET there is often talk about the DAL(Data Access Layer). To me their purpose seems quite similar. So the question is are DAO and DAL basically the same thing? Is the term DAL only made up so it wouldn't be mixed up...

Any tips on avoiding code Duplication on this abstraction?

Hi, So I'm building an App using the Entity Framework on top of SQL Compact Edition. I didn't like the idea of using the Entites as my business objects so I've been building a layer (I've called it ObjectModel layer, prob not the best terminology) in-between that will take my plain objects, use them to populate and save the entities. And...

Using a remote, external web service instead of a database

I am building an ASP.NET web application that will be deployed to a 4-node web farm. My web application's farm is located in California. Instead of a database for back-end data, I plan to use a set of web services served from a data center in New York. I have a page /show-web-service-result.aspx that works like this: 1) User requests...

Disposing SqlConnection from a base DAL class when calling ExecuteReader

I've been assigned on a project where the DAL consists of a base class with functions to return IDataReader, an Object (int, string and the like), or a DataSet. An ExecuteNonQuery function also exists. This DAL only accesses USPs (SQL Server), and is using MS's SqlHelper to execute the queries. Here's two sample functions from the base: ...

ASP.NET Provider Model for Data Access

Hello Just been introduced to the ASP.NET Provider Model as a potential data-access technology. My own idea is to use LINQ repositories, but want to keep an open mind. Any thoughts? Thanks ...

Unit Testing and Stored Procedures

How do you unit test your code that utilizes stored procedure calls? In my applications, I use a lot of unit testing (NUnit). For my DAL, I use the DevExpress XPO ORM. One benefit of XPO is that it lets you use in-memory data storage. This allows me to set up test data in my test fixtures without having an external dependency on a da...

N Tiers with SubSonic 3, Dirty Columns collection is alwayes empty on update

Hello guys here is what i am doing, and not working for me. I have a DAL generated with SubSonic 3 ActiveRecord template, i have a service layer (business layer if you well) that have mixture of facade and some validation. say i have a method on the Service layer like public void UpdateClient(Client client); in my GUI i create a Clien...

SharePoint List like Data Access Interface

Hello, I am impressed by the way we programmatically access lists in SharePoint. I percieve it as a Data Access Layer, while modeling the database is as simple as defining the columns in the List. I am looking for a tool OR an application that would give me similar interface to a database. Basically, for some reason I cannot use ShareP...

Datareader or Dataset in Winform with long trips to database?

I've got a Winform app that will be used in the US and China. The SQL Server 2005 database is in the US, so the data access is going to be slower for the people in China. I'm deciding between using a DataReader and a Dataset for best performance. The data will immediately be loaded into business objects upon retrieval. Question: Which p...

Recommended data structure for a Data Access layer

I am building a DataAccess layer to a DB, what data structure is recommended to use to pass and return a collection? ...

Database Agnostic Reporting Frameworks

Hello, I am currently designing a .NET application using NHibernate as its DAL. I want the application to be as DB agnostic as possible and NHibernate certainly helps me achieve this. However, I know my application will need to have reporting capabilities and was wondering if there is an existing framework or set of best practices for cr...

How to write unit tests for database calls

I'm near the beginning of a new project and (gasp!) for the first time ever I'm trying to include unit tests in a project of mine. I'm having trouble devising some of the unit tests themselves. I have a few methods which have been easy enough to test (pass in two values and check for an expected output). I've got other parts of the co...

ASP.NET : database independent data accses layer

I would like to develop a database independent data access layer for my web application.This data access layer should communicate with any external(as far as my application is concerned) databases like Ms SQL server,Oracle,Access etc... (as per the user's preference) .I will provide various options-various databases like SQL server,Acces...

Problems with connection strings with DAL in separate project

I originally wrote a data access layer inside an App_Code folder in my website. Then we developed a web service in a separate project. So that both the website and the web service can access the same DAL, I moved it to a different project. I have a dataset with tableadapters and to make the DAL project compile I had to add the connection...

Generic DataAccess Layer in C# 3.5

What are the best practices to creating a Generic DataAccess Layer in C# 3.5. Dose LINQ to SQL have any support for Other DataSources like MySQL , Oracle etc. ...

Problem: Sorting for GridView/ObjectDataSource changes depending on page

I have a GridView tied to an ObjectDataSource using paging. The paging works fine, except that the sort order changes depending on which page of the results is being viewed. This causes items to reappear on subsequent pages among other issues. I traced the problem to my DAL, which reads a page at a time and then sorts it. Obviously the...

What would you do to avoid conflicting data in this database schema?

Hi, I'm working on a multi-user internet database-driven website with SQL Server 2008 / LinqToSQL / custom-made repositories as the DAL. I have run across a normalization problem which can lead to an inconsistent database state if exploited correctly and I am wondering how to deal with the problem. The problem: Several different compa...

O/R Mappers - Good or bad

I am really torn right now between using O/R mappers or just sticking to traditional data access. For some reason, every time I bring up O/R mappers, fellow developers cringe and speak about performance issues or how they're just bad in general. What am I missing here? I'm looking at LINQ to SQL and Microsoft Entity Framework. Is ther...

Reuseable ObjectContext or new ObjectContext for each set of operations?

I'm new to the Entities Framework, and am just starting to play around with it in my free time. One of the major questions I have is regarding how to handle ObjectContexts. Which is generally preferred/recommended of these: This public class DataAccess{ MyDbContext m_Context; public DataAccess(){ m_Context = new MyDb...

Data Access Layer and Business Objects

Not sure if I have the correct terminology, but I am a little confused on how to set up my 3-tier system. Lets say I have a table of Users in my DB. In my DAL, I have a UserDB class that calls stored procs into he DB to insert, update, delete. I also have a UserDetails class that is used in UserDB to return and pass in objects. So now...