SQL Server 2000, Self-Serving, LLBLGen Pro 2.5 Build April 23rd Build

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 12-Dec-2008 20:37:02   

Hi all,

I'm having some issues with BIT fields:

Schedules.GetMulti(New PredicateExpression(TaskFields.IsEnabled = True), _ 0, _ Nothing, _ New RelationCollection(ScheduleEntity.Relations.TaskEntityUsingTaskId))

This returns 0 records.

Schedules.GetMulti(New PredicateExpression(TaskFields.IsEnabled = 1), _ 0, _ Nothing, _ New RelationCollection(ScheduleEntity.Relations.TaskEntityUsingTaskId))

This returns the proper amount of records.

How come I cannot use TaskFields.IsEnabled = true? Why must I convert it to a 1/0 for the query to execute correctly?

Here is the query being executed:


Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
Method Enter: DaoBase.ExecuteMultiRowRetrievalQuery
Method Exit: DaoBase.ExecuteSingleRowRetrievalQuery
Method Exit: DaoBase.PerformFetchEntityAction
Method Exit: DaoBase.ExecuteMultiRowRetrievalQuery
Method Exit: DaoBase.PerformGetMultiAction
Method Enter: DaoBase.PerformGetMultiAction
Method Enter: CreatePagingSelectDQ
Method Enter: CreateSelectDQ
Method Enter: CreateSelectDQ
Generated Sql query: 
    Query: SELECT DISTINCT [Unified].[dbo].[Schedules].[ScheduleID] AS [F0], [Unified].[dbo].[Schedules].[TaskID] AS [F1], [Unified].[dbo].[Schedules].[Type] AS [F2], [Unified].[dbo].[Schedules].[StartDate] AS [F3], [Unified].[dbo].[Schedules].[EndDate] AS [F4], [Unified].[dbo].[Schedules].[RunTime] AS [F5], [Unified].[dbo].[Schedules].[LastRun] AS [F6], [Unified].[dbo].[Schedules].[IsEnabled] AS [F7], [Unified].[dbo].[Schedules].[Interval] AS [F8], [Unified].[dbo].[Schedules].[Day] AS [F9] FROM ( [Unified].[dbo].[Tasks]  INNER JOIN [Unified].[dbo].[Schedules]  ON  [Unified].[dbo].[Tasks].[TaskID]=[Unified].[dbo].[Schedules].[TaskID]) WHERE ( ( [Unified].[dbo].[Tasks].[IsEnabled] = @IsEnabled1))
    Parameter: @IsEnabled1 : Boolean. Length: 0. Precision: 1. Scale: 0. Direction: Input. Value: True.

Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
Method Enter: DaoBase.ExecuteMultiRowRetrievalQuery
Method Exit: DaoBase.ExecuteMultiRowRetrievalQuery
Method Exit: DaoBase.PerformGetMultiAction

Table Definition


USE [Unified]
GO
/****** Object:  Table [dbo].[Tasks]    Script Date: 12/12/2008 14:53:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Tasks](
    [TaskID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_Tasks_TaskID]  DEFAULT (newid()),
    [Name] [varchar](50) NOT NULL,
    [Assembly] [varchar](255) NOT NULL,
    [Task] [varchar](255) NOT NULL,
    [State] [int] NOT NULL CONSTRAINT [DF_Tasks_State]  DEFAULT (0),
    [IsEnabled] [bit] NOT NULL CONSTRAINT [DF_Tasks_IsEnabled]  DEFAULT (0),
    [IsAutoStart] [bit] NOT NULL CONSTRAINT [DF_Tasks_IsAutoStart]  DEFAULT (0),
 CONSTRAINT [PK_Tasks] PRIMARY KEY CLUSTERED 
(
    [TaskID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

I just updated to the latest v2.5 runtimes, and I'm still having the same issue.

Thanks!

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 12-Dec-2008 21:02:44   

Found the problem...

Schedules.GetMulti(New PredicateExpression(TaskFields.IsEnabled = True), _ 0, _ Nothing, _ New RelationCollection(ScheduleEntity.Relations.TaskEntityUsingTaskId))

I was passing in a predicate expression into the function...