943,147 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 624
  • VB.NET RSS
Jan 20th, 2010
0

Need help in 3-tier coding in retrieving data to label

Expand Post »
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:

VB.NET Syntax (Toggle Plain Text)
  1. Public Function getFeedbackQ(ByVal Question1 As String, ByVal Question2 As String, ByVal Question3 As String) As System.Data.DataSet
  2.  
  3. Dim connectionString As String = My.Settings.dbConnection
  4. Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
  5. Dim queryString As String = "Select Question1, Question2, Question3, SchoolName from FeedbackForms "
  6. Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
  7.  
  8. dbCommand.CommandText = queryString
  9. dbCommand.Connection = dbConnection
  10.  
  11. Dim dataAdapter As SqlDataAdapter = New System.Data.SqlClient.SqlDataAdapter
  12. dataAdapter.SelectCommand = dbCommand
  13.  
  14. Dim dataSet As System.Data.DataSet = New System.Data.DataSet
  15. dataAdapter.Fill(dataSet, "AllQuestions")
  16.  
  17. Return dataSet
  18.  
  19. End Function

& this is the code in business layer:

VB.NET Syntax (Toggle Plain Text)
  1. Public Function getFeedbackQ(ByVal Question1 As String, ByVal Question2 As String, ByVal Question3 As String, ByVal SchoolName As String) As System.Data.DataSet
  2. Dim ds As Data.DataSet = UserDA.getFeedbackQ(Question1, Question2, Question3, SchoolName)
  3. Return ds
  4. End Function

& in the presentation layer (page load):


VB.NET Syntax (Toggle Plain Text)
  1. Dim UserController As New BusinessLogic.UserBLL
  2. Dim ds As System.Data.DataSet = UserController.getFeedbackQ(label1.Text, label2.Text, label3.Text)
Last edited by adatapost; Jan 20th, 2010 at 10:42 pm. Reason: Added [code] tags. Encase your code in: [code] and [/code] tags.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Clyw is offline Offline
2 posts
since Jan 2010
Jan 22nd, 2010
0
Re: Need help in 3-tier coding in retrieving data to label
Quote ...
From WikiPedia
SUMMARY:
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.

http://en.wikipedia.org/wiki/File:Ov...torVersion.svg
Last edited by adatapost; Jan 22nd, 2010 at 2:33 am.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,525 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Datagridview Header Row Format
Next Thread in VB.NET Forum Timeline: Question about WSDL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC