v2.5 内联视图翻页出错

0 views
Skip to first unread message

sw00...@gmail.com

unread,
Nov 17, 2006, 3:32:43 AM11/17/06
to NBear Google Group
实体定义
[Table("select
BBSMsgID,BBSID,BBSMsg,PostDate,Status,BBS_Msg.UserID,NickName,Email
from BBS_Msg,User_Login where BBS_Msg.UserID =
User_Login.UserID",IsView=true)]
public interface User_Msg : IEntity
{
[PrimaryKey]
int BBSMsgID { get;}
int BBSID { get;}
int UserID { get;}
string BBSMsg { get;}
DateTime PostDate { get;}
int Status { get;}
string NickName { get;}
string Email { get;}
}

查询方法
public User_Msg[] selectUserMsg(int pageSize, int pageNo, int bbsID)
{
return Gateway.Default.Select<User_Msg>(pageSize, pageNo,
_Entity.User_Msg.BBSID == bbsID & _Entity.User_Msg.Status == 1,
_Entity.User_Msg.PostDate.Asc);
}

pageSize=5,显示第一页没错
翻第二页出错
提示
在查询表达式 '([BBSID] = @BBSID_ea31057b5fae4a2c96fb8d518d3adcc9
) AND ([Status] = @Status_476e4bbfabe143d6b75dfa277075336b ) AND (
[BBSMsgID] NOT IN ( SELECT TOP 5 [BBSMsgID] __AliasName WHERE ([BBSID]
= @BBSID_ea31057b5fae4a2c96fb8d518d3adcc9Inside ) AND ([Status]'
中。

希望Teddy帮我看看

Teddy

unread,
Nov 17, 2006, 3:36:29 AM11/17/06
to nbear...@googlegroups.com
对于内联视图,在视图较复杂时可能会有这样的问题。可以将该视图建立到数据库中,然后,在实体代码中用数据库中的视图名称代替内联视图代码,应该就不会出错了。

sw00...@gmail.com

unread,
Nov 17, 2006, 3:38:05 AM11/17/06
to NBear Google Group
可是我目前在用ACCESS开发

Teddy

unread,
Nov 17, 2006, 3:38:43 AM11/17/06
to nbear...@googlegroups.com
access一样支持数据库视图。

On 11/17/06, sw00...@gmail.com <sw00...@gmail.com> wrote:
可是我目前在用ACCESS开发

sw00...@gmail.com

unread,
Nov 17, 2006, 4:13:54 AM11/17/06
to NBear Google Group
搞定了,谢谢Teddy,我还一直为ACCESS没视图而苦恼,呵呵
Reply all
Reply to author
Forward
0 new messages