日期:2014-05-17  浏览次数:20377 次

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)]