They are different things.
DAL ( Data Access Layer ) - Is a project / layer responsible for the structure for access and persistence of application data. It is an architecture standard for separating the database access structure from the application's presentation layer.
The DAL has Data Access Object (DAO) objects that hide the complexity of data access logic. DAO is a design standard.
Example:
Imagine a database access scenario, where you have codes with the configuration / creation of your connection like this (below) spread out in your data presentation layer:
...
var conexao = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASource=c:\Teste.mdb" );
conexao.Open();
comando = New OleDbCommand( "Insert INTO Teste ( Nome ) Values ( 'Xpto' )", conexao );
comando.ExecuteNonQuery();
conexao.Close();
...
This would lead to code replication, difficulty keeping the code spread by the application, and any change in data access would mean changing the entire application.
The idea of DAO is that this responsibility should be concentrated on a separate layer independent of layers.
The presentation layer should not contain any reference to this data access code.
An interface is created so that the other layers use data access methods.
Example:
public interface IClienteDAO<T>
{
List<T> ExibirTodos( );
void Gravar(T obj);
List<Cliente> Consultar(string nome);
}
IClienteDAO implementation:
public class ClienteDAO : IClienteDAO<Cliente>
{
public List<Cliente> Consultar(string nome)
{
try
{
using (SqlConnection con = ConexaoBD.GetInstancia.GetConnection()) {
try
{
con.Open();
string sql = ("Select nome, idade from clientes where nome = '" + nome + "'");
...
}
catch (SqlException ex)
{
throw ex;
}
...
}
}
//Demais métodos como ExibirTodos, Gravar...
}
References: DAO , DAL