Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with creating a 3 tier web design

Posted on 2006-11-21
1
Medium Priority
?
282 Views
Last Modified: 2011-08-18
Hi
can any please complete the code below so that I can try and understand how to create a 3 tier web design.

 ============== Presention layer index.aspx==============================

<asp:FormView ID="frmCustomerDetails" Caption="Customer Details" runat="server">
    <ItemTemplate>
    <%# Eval("YourName") %>
    </ItemTemplate>
    </asp:FormView>

 ============== Code behind index.aspx.cs==============================

protected void Page_Load(object sender, EventArgs e)
        {
       
                try
            {
            FormsIdentity objLoginTicket;
            objLoginTicket = (FormsIdentity)User.Identity;
            IntReturnOrderNumber = Convert.ToInt32(objLoginTicket.Ticket.UserData);
            frmCustomerDetails.DataSource =
            frmCustomerDetails.DataBind()

I DO NOT KNOW HOW TO PASS THE VALUE OF IntReturnOrderNumber INTO THE BUSINESS LAYER

============== Business layer customerdetailsBL.cs ==============================

Not sure what goes here

============== Database layer customerdetailsDB.cs ==============================
public CustomerDetailsBL GetCustomerDetails(int IntReturnOrderNumber)
            {
            SqlConnection Conn = new SqlConnection(getdbConnection);
            SqlCommand Cmd = new SqlCommand("sp_xxxxx", Conn);
            Cmd.CommandType = CommandType.StoredProcedure;
            Cmd.Parameters.Add(new SqlParameter("@CustomerID", SqlDbType.Int, 4));
            Cmd.Parameters["@CustomerID"].Value = IntReturnOrderNumber;

            try
                {
                Conn.Open();
                SqlDataReader Rdr = Cmd.ExecuteReader(CommandBehavior.SingleRow);
                Rdr.Read();
                CustomerDetailsBL CustDtl = new CustomerDetailsBL(
                   (int)Rdr["OrderNumber"],
                    (string)Rdr["UserName"],
                     (string)Rdr["PassWord"],
                      (string)Rdr["YourName"],
                       (string)Rdr["JobTitle"],
                        (string)Rdr["CompanyName"],
                         (string)Rdr["CompanyAddress"],
                          (string)Rdr["CompanyCityTown"],
                           (string)Rdr["CompanyCountyState"],
                            (string)Rdr["CompanyPostCodeZipCode"],
                             (string)Rdr["CompanyCountry"],
                              (string)Rdr["CompanyPhone"]);
                Rdr.Close();
                return CustDtl;
                }
            catch (SqlException)
                {
                throw new ApplicationException("Sorry an error has occured");
                }
            finally
                {
                Conn.Close();
                Conn.Dispose();
                }
            }

Any help would be appreciated
George


0
Comment
Question by:LearningCSharpSQL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
boy8964 earned 2000 total points
ID: 17993370
I think you are little bit confuse with 3-tiers application.

Should do this:

1. Create seperate projects for each layer.
2. from Presention layer, create an object of bussiness layer
3. the class in bussiness layer process data and then create ao object of data access layer
4. class in data access layer insert data into database.

this is logic 3-tiers application.

However, we can also do phsical 3-tiers application as well - it is out of this topic.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question