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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:26:04+00:00 2026-06-07T03:26:04+00:00

My control doesnt return the values in my gridview. table adapter runs the query

  • 0

My control doesnt return the values in my gridview.

table adapter runs the query fine and displays the data.

Here is my code from the control:

 categoriesBLL categoriesLogic = new categoriesBLL();
 GridView1.DataSource = categoriesLogic.GetCategories();
 GridView1.DataBind();

and here is my BLL:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NopSolutions.NopCommerce.Nop.DataAccess.MegaProductMenuTableAdapters;

namespace NopSolutions.NopCommerce.BusinessLogic.MegaProductsMenu
{
    [System.ComponentModel.DataObject]
    public class categoriesBLL
    {

        private Nop_CategoryTableAdapter _categoriesAdapter = null;
        protected Nop_CategoryTableAdapter Adapter
        {
            get
            {
                if (_categoriesAdapter == null)
                    _categoriesAdapter = new Nop_CategoryTableAdapter();

                return _categoriesAdapter;
            }
        }



        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public Nop_CategoryTableAdapter GetCategories()
        {
            return _categoriesAdapter;
        }


    }

}

My DAL looks like this:

enter image description here

If connect directly to the DAL I can get the values to show up. So i think there is something wrong with my BLL, but what could it be? I receive no error messages.

My gridview source:

    <asp:GridView ID="GridView1" runat="server" CssClass="DataWebControlStyle" AutoGenerateColumns="True">
       <HeaderStyle CssClass="HeaderStyle" />
       <AlternatingRowStyle CssClass="AlternatingRowStyle" />
    </asp:GridView>
  • 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-06-07T03:26:06+00:00Added an answer on June 7, 2026 at 3:26 am

    I solved this by asigning the datatable:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using NopSolutions.NopCommerce.Nop.DataAccess.MegaProductMenuTableAdapters;
    
    namespace NopSolutions.NopCommerce.BusinessLogic.MegaProductsMenu
    {
        [System.ComponentModel.DataObject]
        public class categoriesBLL
        {
    
            private Nop_CategoryTableAdapter _categoriesAdapter = null;
            protected Nop_CategoryTableAdapter Adapter
            {
                get
                {
                    if (_categoriesAdapter == null)
                        _categoriesAdapter = new Nop_CategoryTableAdapter();
    
                    return _categoriesAdapter;
                }
            }
    
            [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
            public NopCommerce.Nop.DataAccess.MegaProductMenu.Nop_CategoryDataTable GetCategories()
            {
                return Adapter.GetCategories();
            }
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview that I'm trying to validate from code behind. In this
Grepping non printable characters doesn't seem to work for carriage return (control key ^M).
DockingManager control has been removed from their suite in Q1 2011, so now I
I am retrieving several properties of a control. Here is how I used to
I'm binding an UltraTree control (version 10.3) to a custom data source, like so:
i have database table with few text fields which i use to filter data
I have a Textbox in a User Control i'm trying to update from my
The generated HTML code for my custom ASP.net server control generates the name attribute
After always running monolithic blocks of code from within my AppController object, I've just
I am trying to get AxisX interval for MS Chart Control in code behind.

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.