我在我的Linq-To-Sql模型中有一個類,並試圖將存儲過程映射到它。無論我嘗試,我得到的消息:Linq-To-Sql SP不會映射到類
one or more selected database objects return a schema that does not match
的模式肯定不比賽,我甚至使出只是做產生的汽車「選擇前100行」在SSMS並把這個在SP,閒來無事,和我仍然收到此消息。
還有什麼我應該看?
我的表架構如下:
CREATE TABLE [dbo].[Booking](
[ID] [int] IDENTITY(1,1) NOT NULL,
[ClientID] [int] NULL,
[BookingTypeID] [int] NULL,
[LinkedBookingID] [int] NULL,
[DateCreated] [smalldatetime] NULL,
[DateUpdated] [smalldatetime] NULL,
[BookingDateTime] [smalldatetime] NULL,
[BookingStatusID] [int] NULL,
[ConfirmationRequired] [bit] NOT NULL,
[Confirmed] [bit] NOT NULL,
[InProgress] [bit] NOT NULL,
[ServiceID] [int] NULL,
[EmployeeID] [int] NULL,
[Duration] [int] NULL,
[ProcessingDuration] [int] NULL,
[IsPartOfCourse] [bit] NULL,
[CancellationReason] [int] NULL,
[Timestamp] [timestamp] NULL,
[IsLinked] [bit] NULL,
CONSTRAINT [PK_Booking] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
和SP:
CREATE PROCEDURE booking_test
AS
BEGIN
SELECT TOP 1000 [ID]
,[ClientID]
,[BookingTypeID]
,[LinkedBookingID]
,[DateCreated]
,[DateUpdated]
,[BookingDateTime]
,[BookingStatusID]
,[ConfirmationRequired]
,[Confirmed]
,[InProgress]
,[ServiceID]
,[EmployeeID]
,[Duration]
,[ProcessingDuration]
,[IsPartOfCourse]
,[CancellationReason]
,[Timestamp]
FROM [Booking]
END
GO
請顯示一些SP代碼/模式/對象嗎?你的linq2sql類和sp表中的表之間是否存在任何不一致? – Jimmy 2011-01-28 17:32:36