我的控件不会返回我的gridview中的值。gridview不显示通过BLL的值?
表适配器运行查询罚款并显示数据。
这里是控制我的代码:
categoriesBLL categoriesLogic = new categoriesBLL();
GridView1.DataSource = categoriesLogic.GetCategories();
GridView1.DataBind();
,这里是我的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;
}
}
}
我DAL看起来是这样的:
如果直接连接到DAL我可以得到值显示。所以我认为我的BLL出了问题,但它会是什么?我收到没有错误消息。
我的GridView控件来源:
<asp:GridView ID="GridView1" runat="server" CssClass="DataWebControlStyle" AutoGenerateColumns="True">
<HeaderStyle CssClass="HeaderStyle" />
<AlternatingRowStyle CssClass="AlternatingRowStyle" />
</asp:GridView>
显示你的GridView的代码(源)。 – 2012-07-08 13:26:27
@DigitalAssets:添加了源代码。 – 2012-07-08 13:28:19