0

I'm trying to add data to the Event table in SQL Server. This is the table details:

CREATE TABLE [dbo].[Event]
(
    [EventID] [int] IDENTITY(1001,1) NOT NULL,
    [EventName] [nvarchar](50) NOT NULL,
    [EventDesc] [nvarchar](50) NOT NULL,
    [EventLogo] [image] NULL,
    [EventLocation] [decimal](9, 6) NULL,
    [EventDate] [nvarchar](20) NOT NULL,
    [EventStartTime] [nvarchar](7) NOT NULL,
    [EventEndTime] [nvarchar](7) NOT NULL,
    [NumOfAttendees] [nvarchar](7) NULL,
    [EventStatus] [nvarchar](5) NOT NULL,
    [UserID] [int] NULL,
    [CategoryID] [int] NULL,
    [RatingID] [int] NULL,
    [FeedbackID] [int] NULL
)

This is where I receive the error:

Keyword, identifier or string expected after verbatim specifier @

This is the EventController code:

public ActionResult Index()
{
    var events = db.Events.Include(@ => @.Category).Include(@ => @.Feedback).Include(@ => @.Rating).Include(@ => @.User);
    return View(events.ToList());
}
1
  • Keyword, identifier or string expected after verbatim specifier @ in the index action Commented Aug 18, 2015 at 9:54

1 Answer 1

1

Change it to -

db.Events.Include(c => c.Category).Include(f => f.Feedback).Include(r => r.Rating).Include(u => u.User);

@ is a keyword which is used for verbatim literals.

Sign up to request clarification or add additional context in comments.

2 Comments

@JohnaneUmslana if this answer solves your issue, then consider accepting this answer so other people will know that your issue is resolved.
Thanks for the heads up ekad

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.