首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

ObjectDataSource配置数据时业对象为空,该怎么解决

2012-05-16 
ObjectDataSource配置数据时业对象为空在使用ObjectDataSource时,到选择业务对象那一步,可是什么对象都没

ObjectDataSource配置数据时业对象为空
在使用ObjectDataSource时,到选择业务对象那一步,可是什么对象都没有,在APP_CODE下却是有的.

[解决办法]

探讨
引用:
自己写一下吗 不要太依赖工具

你误解了,我是自已写了业务对象类,但却在用ObjectDataSource选择数据源时,下拉列表框中的业务对象却为空,
什么都没有。这才郁闷了。

[解决办法]
你可以试试,先在生成里面点重新生成解决方案,再点你的数所源控件,再在上面找到一个刷新框架的字样点下就OK啦
[解决办法]
using System;
using System.Collections.Generic;
using System.Text;
using HotelDAL;
using HotelModel;
using System.ComponentModel;

namespace HotelBLL
{
[DataObject()]
public class RoomTypeManager
{
[DataObjectMethod(DataObjectMethodType.Select)]
public static List<RoomType> GetRoomType()
{
return RoomTypeService.GetRoomType();
}

[DataObjectMethod(DataObjectMethodType.Select)]
public static RoomType GetRoomTypeByTypeId(int typeId)
{
return RoomTypeService.GetRoomTypeByTypeId(typeId);
}

[DataObjectMethod(DataObjectMethodType.Update)]
public static int UpdateRoomTypeByTypeId(RoomType roomType)
{
return RoomTypeService.UpdateRoomTypeByTypeId(roomType);
}

[DataObjectMethod(DataObjectMethodType.Insert)]
public static int InsertRoomTypeByTypeId(RoomType roomType)
{
return RoomTypeService.InsertRoomType(roomType);
}

[DataObjectMethod(DataObjectMethodType.Delete)]
public static int DeleteRoomTypeByTypeId(int typeId)
{
return RoomTypeService.DeleteRoomTypeByTypeId(typeId);
}
}
}

加上[DataObjectMethod(DataObjectMethodType.Delete)]

热点排行