Hai..Good evening Frnds...
I need 3-tier architecture & N-tier Architecture best examples and how we use in our projects... plz help me....
Thanks in Advance Dudes :)
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anurag SarkarRank #1,049 · 1.8K reputationPosted May 17, 2013, 7:54 AM EDT
Chintan RathodRank #516 · 4.8K reputationPosted May 20, 2013, 4:03 AM EDT
3 tier architecture
N tier architecture
http://www.codeproject.com/Articles/434282/A-N-Tier-Architecture-Sample-with-ASP-NET-MVC3-WCF
Sandeep Singh ShekhawatRank #147 · 15.6K reputationPosted May 20, 2013, 4:07 AM EDT
http://www.dotnetfunda.com/articles/article71.aspx
Lalit Raghuvanshi50 reputationPosted Apr 2, 2014, 8:34 AM EDT
selvi subramanianRank #2,007 · 723 reputationPosted Apr 2, 2014, 10:21 PM EDT
2nd to create in the name of BAL
3rd u have to design a page
DAL code
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
///
/// Summary description for DAL
///
public class DAL
{
string s = ConfigurationManager.AppSettings["ss"].ToString();
SqlConnection con = new SqlConnection();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet ds = new DataSet();
public DAL()
{
//
// TODO: Add constructor logic here
//
}
public int inset(string FName, string Age, string Resume)
{
con = new SqlConnection(s);
con.Open();
try
{
string qr="insert into thretier(FName,Age,Resume) values ('" + FName + "','" + Age + "','" + Resume + "')";
cmd = new SqlCommand(qr,con);
return cmd.ExecuteNonQuery();
}
catch {
throw;
}
finally
{
cmd.Dispose();
con.Dispose();
con.Close();
}
}
public DataTable selcc()
{
con = new SqlConnection(s);
con.Open();
try
{
string qry="select * from thretier";
cmd=new SqlCommand(qry,con);
SqlDataAdapter da=new SqlDataAdapter(cmd);
DataTable dt=new DataTable();
da.Fill(dt);
return dt;
}
catch(Exception)
{
throw;
}
finally
{
cmd.Dispose();
con.Dispose();
con.Close();
}
}
}
BAL code
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
///
/// Summary description for BAL
///
public class BAL
{
DAL ash=new DAL();
public BAL()
{
//
// TODO: Add constructor logic here
//
}
public int inset(string FName, string Age, string Resume)
{
try
{
return ash.inset(FName, Age, Resume);
}
catch
{
throw;
}
finally
{
ash = null;
}
}
public DataTable getdaa()
{
try
{
return ash.selcc();
}
catch
{
throw;
}
finally
{
}
}
}
3rd design
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
.style1
{
width: 100%;
}
.style2
{
width: 556px;
}
code
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
BAL selv = new BAL();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
aggg();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
aggg();
string Filena = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName.ToString());
string save = Server.MapPath("Resume") + "\\" + Filena;
if (FileUpload1.PostedFile != null)
{
FileUpload1.PostedFile.SaveAs(save);
}
string FName = txname.Text;
string Age = tage.Text;
string Resume = Filena.ToString();
int dash;
dash=selv.inset(FName,Age,Resume);
}
private void aggg()
{
ListItem li = new ListItem();
li.Text = "Select";
li.Value = "0";
ddag.Items.Add(li.ToString());
for (int i = 0; i <= 100; i++)
{
ddag.Items.Add(Convert.ToString(i));
}
}
}