I'm trying to add a table from my database to my LINQ to SQL data context. It wont let me. Looking at the table in the designer in visual studio it seems it isn't recognising the Id as a primary key. I cant see anything wrong with the table. Any ideas would be appreciated.
Here is my table;
USE [fldt_bt_wbc]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[btRequests](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [varchar](25) NOT NULL,
[RequestType] [int] NOT NULL,
[DateTime] [datetime] NOT NULL,
[Status] [varchar](20) NULL,
[ConversationID] [varchar](50) NULL,
CONSTRAINT [PK_btRequests] PRIMARY KEY CLUSTERED
(
开发者_开发问答 [ID] 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
GO
ALTER TABLE [dbo].[btRequests] WITH CHECK ADD CONSTRAINT [FK_btRequests_RequestType] FOREIGN KEY([RequestType])
REFERENCES [dbo].[RequestType] ([ID])
GO
ALTER TABLE [dbo].[btRequests] CHECK CONSTRAINT [FK_btRequests_RequestType]
GO
Thanks Pleun, I created a clean fresh project and it worked.
精彩评论