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

linq中参数超过10以后会报错

2014-01-28 
linq中参数超过10以后会报错,大家有好的解决方法吗?如下例所示: 本来 ]([t1].[HCHotelSupplierID] IN (@p11

linq中参数超过10以后会报错,大家有好的解决方法吗?

如下例所示:
本来 ]([t1].[HCHotelSupplierID] IN (@p11, @p12, @p13)) 中参数 @p11, @p12, @p13  是应该对应
@p1 [DateTime]: 2009-3-16 0:00:00
@p11 [Int32]: 12
@p12 [Int32]: 9
@p13 [Int32]: 0

但现在参数调用乱了,他是分开调用 @p1  1, @p1 2, @p1  3  这样调用所以变成这样了

('2009-3-16 0:00:00'1, '2009-3-16 0:00:00'2, '2009-3-16 0:00:00'3))

不清楚,大家看明白了吗,请求大家的帮助。

SQL code
SELECT [t0].[HCRoomTypeID], [t0].[HCRoomPriceID], [t0].[GuestTypeCode], [t0].[ValidStartDate], [t0].[ValidEndDate], [t0].[CommendLevelCode], [t0].[RoomPriceStatusCode], [t0].[Setting], [t0].[IsDel], [t0].[IsSpecial]FROM [dbo].[HCRoomPrice] AS [t0]INNER JOIN [dbo].[HCRoomType] AS [t1] ON [t1].[HCRoomTypeID] = [t0].[HCRoomTypeID]WHERE ([t1].[HCHotelInfoID] = @p0) AND ((([t0].[ValidStartDate] >= @p1) AND ([t0].[ValidStartDate] <= @p2)) OR (([t0].[ValidEndDate] >= @p3) AND ([t0].[ValidEndDate] <= @p4)) OR (([t0].[ValidStartDate] <= @p5) AND ([t0].[ValidEndDate] >= @p6))) AND (([t0].[ValidStartDate] < @p7) OR (([t0].[ValidStartDate] > @p8) AND ([t0].[ValidEndDate] < @p9)) OR ([t0].[ValidEndDate] > @p10)) AND [color=#FF0000]([t1].[HCHotelSupplierID] IN (@p11, @p12, @p13))[/color]ORDER BY [t0].[HCRoomPriceID]-------------------------------@p0 [Int32]: 10615@p1 [DateTime]: 2009-3-16 0:00:00@p2 [DateTime]: 2009-3-17 0:00:00@p3 [DateTime]: 2009-3-16 0:00:00@p4 [DateTime]: 2009-3-17 0:00:00@p5 [DateTime]: 2009-3-16 0:00:00@p6 [DateTime]: 2009-3-17 0:00:00@p7 [DateTime]: 2009-3-16 0:00:00@p8 [DateTime]: 2009-3-17 0:00:00@p9 [DateTime]: 2009-3-16 0:00:00@p10 [DateTime]: 2009-3-17 0:00:00@p11 [Int32]: 12@p12 [Int32]: 9@p13 [Int32]: 0但现在他转换成SQL 并不是这样的,而是SELECT [t0].[HCRoomTypeID], [t0].[HCRoomPriceID], [t0].[GuestTypeCode], [t0].[ValidStartDate], [t0].[ValidEndDate], [t0].[CommendLevelCode], [t0].[RoomPriceStatusCode], [t0].[Setting], [t0].[IsDel], [t0].[IsSpecial]FROM [dbo].[HCRoomPrice] AS [t0]INNER JOIN [dbo].[HCRoomType] AS [t1] ON [t1].[HCRoomTypeID] = [t0].[HCRoomTypeID]WHERE ([t1].[HCHotelInfoID] = 10615) AND ((([t0].[ValidStartDate] >= '2009-3-16 0:00:00') AND ([t0].[ValidStartDate] <= '2009-3-17 0:00:00')) OR (([t0].[ValidEndDate] >= '2009-3-16 0:00:00') AND ([t0].[ValidEndDate] <= '2009-3-17 0:00:00')) OR (([t0].[ValidStartDate] <= '2009-3-16 0:00:00') AND ([t0].[ValidEndDate] >= '2009-3-17 0:00:00'))) AND (([t0].[ValidStartDate] < '2009-3-16 0:00:00') OR (([t0].[ValidStartDate] > '2009-3-17 0:00:00') AND ([t0].[ValidEndDate] < '2009-3-16 0:00:00')) OR ([t0].[ValidEndDate] > '2009-3-16 0:00:00'0)) AND [color=#FF0000]([t1].[HCHotelSupplierID] IN ('2009-3-16 0:00:00'1, '2009-3-16 0:00:00'2, '2009-3-16 0:00:00'3))ORDER BY [t0].[HCRoomPriceID][/color]        

热点排行