对于那些在亚音速方面表现不错的人!
TblNewsCollection col =
new Select().From(Tables.TblNews)
.InnerJoin(Tables.TblContent)
.Paged(currentPage, pageSize)
.OrderDesc(TblContent.Columns.PubDate)
.ExecuteAsCollection<TblNewsCollection>();
以上工作,没问题,但是当我尝试添加 where 子句时
TblNewsCollection col =
new Select().From(Tables.TblNews)
.InnerJoin(Tables.TblContent)
.Where(TblContent.Columns.UserFK)
.IsEqualTo(guidUserFK)
.Paged(currentPage, pageSize)
.OrderDesc(TblContent.Columns.PubDate)
.ExecuteAsCollection<TblNewsCollection>();
我收到这条消息
System.InvalidCastException: Object must implement IConvertible.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType)
System.InvalidCastException: Failed to convert parameter value from a Guid to a String.
我已经从其他字段尝试过,例如数据库中的一个位字段,它说它不能从布尔转换为位!
似乎只是连接后 where 语句的问题