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

  • SEARCH
  • Home
  • 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 6080867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:06:38+00:00 2026-05-23T11:06:38+00:00

<asp:Content ID=Content2 ContentPlaceHolderID=ContentPlaceHolder1 Runat=Server> <div> <asp:GridView ID=GridView1 runat=server Height=464px Width=743px AutoGenerateColumns=False EmptyDataText=No Rows Selected

  • 0
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>
    <asp:GridView ID="GridView1" runat="server" Height="464px" Width="743px" 
        AutoGenerateColumns="False" EmptyDataText="No Rows Selected" 
        DataSourceID="Answered" 

        style="z-index: 1; left: 327px; top: 334px; position: absolute; height: 464px; width: 743px">
        <Columns>
            <asp:BoundField DataField="ThreadTitle" HeaderText="ThreadTitle" 
                SortExpression="ThreadTitle" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="Answered" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CP_AllQuestionsAnswered %>" SelectCommand="SELECT ThreadTitle
FROM Threads AS t
INNER JOIN Users AS u ON  t.UsersID=u.UsersID
WHERE t.UsersID=@UserID">
        <SelectParameters>
            <asp:Parameter Name="UserID" />
        </SelectParameters>
    </asp:SqlDataSource>
  </div>
</asp:Content>

Code File:

protected void Page_Load(object sender, EventArgs e)
{
    MembershipUser CurrentUser = Membership.GetUser();
    Guid userid = (Guid)CurrentUser.ProviderUserKey;
    Answered.SelectParameters.Add("UserID", userid.ToString().Trim());
}

When I modify the grid’s datasource, I write my query and test it with a specific grid and it gives me the expected results. But when I run the grid view, all I get is “Empty rows”. Why is that?!?

  • 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-23T11:06:39+00:00Added an answer on May 23, 2026 at 11:06 am

    My guess is this: in your Page_Load, you’re constantly adding a new parameter to your SQL datasource, even though that parameter is already defined.

    Try this instead – setting the value of the existing parameter:

    protected void Page_Load(object sender, EventArgs e)
    {
       MembershipUser CurrentUser = Membership.GetUser();
       Guid userid = (Guid)CurrentUser.ProviderUserKey;
       Answered.SelectParameters["UserID"].DefaultValue = userid.ToString().Trim();
    }
    

    Does that change anything?

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

Sidebar

Related Questions

Here's a my Default.aspx page (with unnecessary details excised): <asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder1 Runat=Server> <div
This is my aspx <asp:Content ID=Content2 ContentPlaceHolderID=ContentPlaceHolder1 runat=server> <asp:ObjectDataSource ID=DSCategories runat=server SelectMethod=GetCategories TypeName=BAL.CategoryBAL> </asp:ObjectDataSource>
<asp:Content ID=Content2 ContentPlaceHolderID=ContentPlaceHolder1 Runat=Server> <h3>Request ID:<%=Request[request_id]%></h3> </asp:Content> The Code above is not working. How
I have the following ASP page: <asp:Content ID=Content2 ContentPlaceHolderID=ShellContent runat=server> <form runat=server id=AddNewNoteForm method=post>
I have following view <asp:Content ID=Content2 ContentPlaceHolderID=MainContent runat=server> <h2>Tables <%=ViewData[RetriverName] %></h2> <%using (Html.BeginForm(ResfreshSelectedTables, Home))
I have my asp.net sub-master page setup like this: <asp:Content ID=MainContent runat=server ContentPlaceHolderID=mainContent> <!doctype
I have the following code in the front end <asp:Content ID=Content1 ContentPlaceHolderID=cphMain runat=server> <script
When I type it here :- <asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder2 Runat=Server> <link href=Skins/SkinCustom/Editor.Default.css rel=stylesheet type=text/css
<head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server /></title> <link href=../../Content/css/layout.css rel=stylesheet type=text/css /> <script type=text/javascript src=/Areas/CMS/Content/js/jquery-1.3.2.min.js></script>
I have this code: <div class=LoginBox> <form id=form2 runat=server> <asp:ContentPlaceHolder ID=ContentPlaceHolder2 runat=server> lolbags </asp:ContentPlaceHolder>

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.