You must Sign In to post a response.
  • Category: ASP.NET

    How to pass values from data access layer(dal) to business layer(bal) in 3 tier architecture ?

    I am writing 3 tier code in c# in

    In DAL i am fetching sql table values in dataset

    Now, i want to pass that dataset from DAL to BAL and BAL to presentation layer

    Is it ok to pass whole dataset (?) taking into consideration the application's performance with regards to overall network bandwidth usgae

    If whole dataset passing is not advisable then which is the best alternative way to pass data from dal to bal ?
  • #769165
    Hai Jayesh,
    It is easy to pass the data from one layer to another layer. You just need the reference of the data access layer to your business layer and then you can create object of the class and use the method to pass the data .
    You can go through the below link where I have provided the implementation of such scenario:

    Hope it will be helpful to you.

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • #769167

    You can easily pass dataset data from DAL to BAL by adding referenced assemblies.

    Your DAL should be like below

    public class DataLayer

    public DataSet Get_Data(string SqlStmt)
    SqlConnection con = new SqlConnection(your connection string);
    DataSet ds = new DataSet();
    SqlDataAdapter da = new SqlDataAdapter(SqlStmt, con);
    return ds;

    and in BAL add the reference of DAL dll and call the above mentioned method like below

    public class BLayer

    public DataSet Get_Data()
    DataLayer dl = new DataLayer();
    return dl.Get_Data("select EmpNo,Ename,Job,Mgr,Sal,Comm from Emp");

    Refer below link this might be helpful to you...

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments