Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:35:58+00:00 2026-05-28T00:35:58+00:00

Firstly, i have a grdData at my main page. After choosing the data i

  • 0

Firstly, i have a grdData at my main page. After choosing the data i want and went to another page using

    Request.QueryString("id")

In that page i would like to make another grdData using the

    Request.QueryString("id")

but came upon an error by

    Value of type 'cfeedback' cannot be converted to 'system.collections.arraylist'

Below are my codes

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
    Dim objArrayList As New ArrayList
    Dim objCDBFeedback As New CDBFeedback
    Dim intGuestID2 As Integer
    intGuestID2 = Request.QueryString("id")
    objArrayList = objCDBFeedback.getFeedBack(intGuestID2)
    grdResult.DataSource = objArrayList


    grdResult.DataBind()

    grdResult.HeaderRow.BackColor = Drawing.Color.AliceBlue
    grdResult.RowStyle.BackColor = Drawing.Color.BlanchedAlmond
    grdResult.AlternatingRowStyle.BackColor = Drawing.Color.LightSalmon

    grdResult.Columns(0).Visible = True


End Sub

My Function

    Public Function getFeedBack(ByVal pintGuestID1 As Integer) As CFeedback
    Dim objCmd As New MySqlCommand
    Dim objCn As New MySqlConnection(connectionString)
    Dim objAdapter As New MySqlDataAdapter
    Dim strSQL As String = ""
    Dim objDs As New DataSet
    Dim objDataRow As DataRow

    strSQL = "SELECT * FROM tblFeedback WHERE strGuestCodeFB=" & pintGuestID1
    objCmd.CommandText = strSQL
    objCmd.Connection = objCn
    objAdapter.SelectCommand = objCmd

    objCn.Open()

    objAdapter.Fill(objDs, "tblFeedback")
    objDataRow = objDs.Tables("tblFeedback").Rows(0)
    Dim objCFeedback As New CFeedback


    objCFeedback.Feedback = objDataRow.Item("strGuestCompanyTI")

    objCn.Close()
    Return objCFeedback
End Function

My Class

Public Class CFeedback
Private strGuestCodeFB As Integer
Private strFeedBackFB As String

Public Property GuestId() As String
    Get
        Return strGuestCodeFB
    End Get
    Set(ByVal value As String)
        strGuestCodeFB = value
    End Set
End Property

Public Property Feedback() As String
    Get
        Return strFeedBackFB
    End Get
    Set(ByVal value As String)
        strFeedBackFB = value
    End Set
End Property

End Class

So is it possible to have a grdData base on querystring?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:35:59+00:00Added an answer on May 28, 2026 at 12:35 am

    The very first thing that you need to do is edit your code behind and add the following two lines at the top:

    Option Explicit On
    Option Strict On
    

    This will show you at least one error: assigning a type of CFeedback to a type of ArrayList.

    You will need to determine what the appropriate resolution to this is, but I suspect that you want to return an ArrayList or generic List from GetFeedback instead of just the one item.

    So, among other changes, you will want to change pageload to look something like:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objCDBFeedback As New CDBFeedback
        Dim intGuestID2 As Integer
        intGuestID2 = CInt(Request.QueryString("id"))
    
        Dim cValues As System.Collections.Generic.List(Of CFeedback)
    
        cValues = objCDBFeedback.getFeedBack(intGuestID2)
    
        grdResult.DataSource = cValues
        grdResult.DataBind()
    
        grdResult.HeaderRow.BackColor = Drawing.Color.AliceBlue
        grdResult.RowStyle.BackColor = Drawing.Color.BlanchedAlmond
        grdResult.AlternatingRowStyle.BackColor = Drawing.Color.LightSalmon
    
        grdResult.Columns(0).Visible = True
    
        grdResult.Visible = cValues.Count <> 0
    End Sub
    

    And the getFeeback method to look something like:

        Public Function getFeedBack(ByVal pintGuestID1 As Integer) As System.Collections.Generic.List(Of CFeedback)
            Dim cValues As New System.Collections.Generic.List(Of CFeedback)
    
            Using objCn As New MySqlConnection(connectionString)
                Using objCmd As New MySqlCommand
                    Dim strSQL As String = ""
    
                    strSQL = "SELECT * FROM tblFeedback WHERE strGuestCodeFB=" & pintGuestID1
                    objCmd.CommandText = strSQL
                    objCmd.Connection = objCn
    
                    objCn.Open()
    
                    Using oReader As MySqlDataReader = objCmd.ExecuteReader
                        Do While oReader.Read
                            Dim objCFeedback As New CFeedback
    
                            objCFeedback.Feedback = oReader.Item("strGuestCompanyTI")
    
                            cValues.Add(objCFeedback)
                        Loop
                    End Using
    
                    objCn.Close()
                End Using
            End Using
    
            Return cValues
        End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly, there have some tag links in my main page. click each one, post
I have created firstly ASP.NET MVC 2 . and write more functionality. After I
I have a modeling question related to profiles. Firstly, I have looked into using
Firstly, I have found many examples of how to grab data from a db
Firstly, this seems like something that should have been asked before, but I cannot
Firstly, I would like to say that I have tested if my link to
I have 4 tables that link together... Firstly the hotels table hotel_id town_id hotel_name
I want to modify GDLC MP4 Muxer so that it will not send data
Iam coding in c and using sqlite3 as database .I want to ask that
Firstly, I have done my research and already know that JavaScript = client JSPs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.