Sir, I am always confused of Direct and Indirect Data Retrieve from Database in ASP.NET.
Here I showing It with an example:-
1) Indirect Retrieve:-
protected void btnSave_Click(object sender, EventArgs e)
{
classInfo infoclass = new classInfo();
classSP spClass = new classSP();
infoclass.className = txtClassName.Text;
infoclass.noOfseats = int.Parse(txtnoOfSeats.Text);
spClass.classAdd(infoclass);
}
2)Direct Retrieve:-
In this please send me the reply to the lines I double-slashed.
protected void btnSave_Click(object sender, EventArgs e)
{
// Avoid classinfo and classSP
// set the controls to the adding value
/* what happen when set command like:- SqlCommand cmd=new SqlCommand("Insert into tbl_Class(className,noOfseats) values(@className,@noOfseats)",sqlCon);*/
}
Loading

Iftikar HussainPosted Aug 22, 2013, 12:49 PM
There is no Direct and Indirect retrival of data. There is 3 tier architecture for application.
DAL - DataAccessLayer
BAL - BusinessAccessLayer
UI - UserInterface layer
for good programming practise you need to use 3-tier architecture. Please refer the below link for more details
http://www.codeproject.com/Articles/11128/3-tier-architecture-in-C
Regards,
Iftikar
Jignesh TrivediPosted Aug 22, 2013, 11:28 PM
hi,
agree with Iftikar Hussain, There is no direct and Indirect data retrieve from the database. this is all about way of calling the methods and follow the patterns. this is about separation of layer just described above. i.e. DAL, BAL, etc.
if follow the (1) way than it is 3 tire pattern and if you follow (2) then it is 2 tire pattern
hope this will help you.