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 1045731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:01:54+00:00 2026-05-16T16:01:54+00:00

I have the following DetailsView, with several BoundFields, and SQlDataSource that populates the fields:

  • 0

I have the following DetailsView, with several BoundFields, and SQlDataSource that populates the fields:

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="TICKET_ID"
        DataSourceID="SqlDataSource1" HeaderText="Completed IT ticket information"
        CellPadding="4" ForeColor="#333333" GridLines="None" HorizontalAlign="Center">
        <Fields>
            <asp:BoundField DataField="TICKET_ID" SortExpression="TICKET_ID" Visible="False" />
            <asp:BoundField DataField="SUBMITTED_BY" SortExpression="SUBMITTED_BY" Visible="False" />

            <asp:BoundField DataField="TICKET_TITLE" HeaderText="Ticket Description" SortExpression="TICKET_TITLE" />
            <asp:BoundField DataField="SUBMITTED_BY" HeaderText="Submitted By" SortExpression="SUBMITTED_BY" />
            <asp:BoundField DataField="SOLUTION_NOTES" HeaderText="Solution Notes" SortExpression="SOLUTION_NOTES" />
            <asp:BoundField DataField="EMAIL_HISTORY" HeaderText="Email History" SortExpression="EMAIL_HISTORY" />
            <asp:BoundField DataField="COMPLETED_BY" HeaderText="Completed By" SortExpression="COMPLETED_BY" />
            <asp:BoundField DataField="COMPLETE_DATE" HeaderText="Completed Date" ReadOnly="True" SortExpression="COMPLETE_DATE" />
        </Fields>
    </asp:DetailsView>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TTPRODConnectionString %>"
        SelectCommand="SELECT USR_ITFAC.TS_ID AS TICKET_ID, USR_ITFAC.TS_EC1_SUBMITTER AS SUBMITTED_BY, USR_ITFAC.TS_TITLE AS TICKET_TITLE, USR_ITFAC.TS_SOLUTION_NOTES AS SOLUTION_NOTES, USR_ITFAC.TS_EMAIL_HISTORY AS EMAIL_HISTORY, TS_USERS.TS_NAME AS COMPLETED_BY, DATEADD(HOUR,-8,USR_ITFAC.TS_CLOSEDATE) AS COMPLETE_DATE FROM USR_ITFAC INNER JOIN TS_USERS ON USR_ITFAC.TS_COMPLETED_BY = TS_USERS.TS_ID WHERE (USR_ITFAC.TS_ISSUEID = '00033')">
        <SelectParameters>
            <asp:QueryStringParameter Name="ts_id" QueryStringField="id" />
        </SelectParameters>
    </asp:SqlDataSource>

I hard-coded a value at the end of the query ‘00033’, which is the ID of a record I know is in the database. I tested the query and it returns a value as expected, what I’m trying to do is fetch the values of the BoundField in the code-behind after a user has pressed a button.

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Try
            ''Use a Dictionary to store answers to questions that were marked poor or fair
            Dim answers As New Dictionary(Of String, String)

            ''For Each test
        For Each dv_row As DetailsViewRow In DetailsView1.Rows
            ''Print rows data to console
        Next

        Catch ex As Exception
            lblWarn.Text = "<br /><b>Please answer all the questions on this survey</b><br />"
            'Response.Write(ex)
        End Try
    End Sub

Above I’m doing a test to fetch the values and print them onscreen, the problem is that the row count is 0, I’m not sure why that is. I expected the row count to be 8, when debugging I notice that the field count is 8, but I’m not sure how to get the values from the fields. I thought the way to get row data was something like:

Dim rowText As String = DetailsView1.Rows(0).Cells(1).Text

But when I try that I get a Null exception. Any insight is appreciated.

  • 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-16T16:01:54+00:00Added an answer on May 16, 2026 at 4:01 pm

    Was able to get it up and running. Turns out the BoundFields were not getting populated because the parameter in the QueryStringField, namely “id”, was not being specified in the request URL. To resolve this I first tried to rewrite the URL path on Page_Load, that didn’t work, so I just created a separate page with a hyperlink to the page I’m working on with a variable appended to the end of the URL which provides the QueryString for the SQLDataSource to reference. More on the QueryString property here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following detailsview in my asp.net web application. What it should show
I have several tables in my database that have read-only fields that get set
I have a DetailsView with several fields. On the same page, I have both
I have following script that executes all the .reg files in the current directory.
I have the following code in my codebehind Page_Load function that sets the default
Am using VS2008 ASP.Net Web Forms have a detailsview, databound to web service reference
I have the following setup: A subclass of UISplitViewController that creates the master and
I have the following set-up: A Window that has a splitView in which I
I am using the following list layout for items that have associated comments .
This is kind of silly but I have a DetailsView that binds to a

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.