my question is how to display record from dataset which is created in DAL.and display record in gridview.....this application in c# windows form
want to understand 3 tier architecture
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Upamanyu Roy ChoudhuryPosted Feb 23, 2013, 1:11 PM
Will you please provide me the code.
I can look into this
vikas kananiPosted Feb 21, 2013, 6:34 AM
Upamanyu Roy ChoudhuryPosted Feb 20, 2013, 1:20 PM
You need to know what s 3 layered architecture first,before you knowe about 3 tier one. The 3 layered architecture comprises of
a. UI Layer
b. Business Layer
c. DAL or Data Access Layer
So you need to create thosew threee layers in order to implement the 3 layered acrchitecture.
The control flows like this
function in UI ---> function in Business Layer---> function in DAL
So we define a function in UI layer like this
function void ShowEmployeeData()
{
// call the function in Business Layer
BusinessClass objBusinesClasss = new BusinessClass();
DataSet ds= objBusinesClasss.GetEmployeeData();
//show the data in the datagridview
DataGridView1.DataSource = ds;
DataGridView1.DataBind();
}
// Business Layer function
public DataSet GetEmployeeData()
{
// call the DAL function to get the dataset
DataLayer objDataLayer = new DataLayer();
objDataLayer.
GetEmployeData();
return ds; /return the data set
}
// The function in the DataLayer
public DataSet GetEmployeeDetilas()
{
//Get the employee data by using the command object,adapter and connection object and storing it in DataSet
DataSet ds= new DataSet();
// store data in ds by calling a store proc or inline sql
return ds;
}
So in this way we generallly implement 3 layered architecture.
Now a 3 tier architecture is an architecture where all those 3 layers are present in different locations or machines.
Following links are going to be very usefull if you want to go in depth
http://www.codeproject.com/Articles/11128/3-tier-architecture-in-C
http://www.aspdotnet-suresh.com/2010/05/introduction-to-3-tier-architecture-in_17.html
http://social.msdn.microsoft.com/Forums/en-US/winformsapplications/thread/2c15af26-7758-4268-9568-5932225cca32/
A video
http://www.youtube.com/watch?v=4n3xzK1Cfh0
If you find this post as useful then please mark is as an answer
Satyapriya NayakPosted Feb 20, 2013, 11:30 AM
http://www.c-sharpcorner.com/UploadFile/gopinath/Developing3-TierApplicationsinCSand.NET12032005013007AM/Developing3-TierApplicationsinCSand.NET.aspx
http://www.c-sharpcorner.com/uploadfile/hgvyas123/3-tier-architecture/
http://www.c-sharpcorner.com/uploadfile/gowth/two-tier-and-three-tier-architecture-with-example/