I need help urgently for 3-tier coding in retrieving data from database and display it in label. It would be a great help if anyone solve it for me. thanks

I got the code for data access layer but im not sure if it's right:

Public Function getFeedbackQ(ByVal Question1 As String, ByVal Question2 As String, ByVal Question3 As String) As System.Data.DataSet

        Dim connectionString As String = My.Settings.dbConnection
        Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
        Dim queryString As String = "Select Question1, Question2, Question3, SchoolName from FeedbackForms "
        Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand

        dbCommand.CommandText = queryString
        dbCommand.Connection = dbConnection

        Dim dataAdapter As SqlDataAdapter = New System.Data.SqlClient.SqlDataAdapter
        dataAdapter.SelectCommand = dbCommand

        Dim dataSet As System.Data.DataSet = New System.Data.DataSet
        dataAdapter.Fill(dataSet, "AllQuestions")

        Return dataSet

    End Function

& this is the code in business layer:

Public Function getFeedbackQ(ByVal Question1 As String, ByVal Question2 As String, ByVal Question3 As String, ByVal SchoolName As String) As System.Data.DataSet
        Dim ds As Data.DataSet = UserDA.getFeedbackQ(Question1, Question2, Question3, SchoolName)
        Return ds
    End Function

& in the presentation layer (page load):

Dim UserController As New BusinessLogic.UserBLL
        Dim ds As System.Data.DataSet = UserController.getFeedbackQ(label1.Text, label2.Text, label3.Text)

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

7 Years
Discussion Span
Last Post by __avd

From WikiPedia

In software engineering, multi-tier architecture (often referred to as n-tier architecture) is a client-server architecture in which the presentation, the application processing, and the data management are logically separate processes. For example, an application that uses middleware to service data requests between a user and a database employs multi-tier architecture. The most widespread use of "multi-tier architecture" refers to three-tier architecture.


Edited by __avd: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.