Tom Halladay
Tom Halladay

Reputation: 5761

"Argument not specified for parameter", but it is specified

I'm trying to pass some parameters into a data annotation, and it is rejecting my named parameter. See below:

enter image description here

It's the same exact syntax in Microsoft's documentation for the TableAttribute, except in the documentation they have an uppercase N, but intellisense on the parameter in VS asks for a lower case n.

Edit: After getting 2 good answers, I just wanted to explain why I thought I could do this in the first place. It looks like the constructor was updated, but the tooltip wasn't, because this is what shows up when you get the syntax prompt:

enter image description here

And I needed to be able to specify schema. But now I've found another way to do this.

Edit #2: Why I was trying named parameters in the first place; because this wasn't working.

enter image description here

Edit #3: Apparently I missed trying this syntax, which works. Figured it out thanks to Damien.

enter image description here

Upvotes: 2

Views: 923

Answers (2)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239764

You're looking at the wrong TableAttribute. The one from the DataAnnotations namespace expects a constructor (non-named) name parameter.

Upvotes: 4

Mike Guthrie
Mike Guthrie

Reputation: 4059

Name isn't an optional parameter for TableAttribute. You don't need to prefix it with name:= at all. Just type as:

<Table("SYSTEMSETTING")>
Public Class MyTableClass

Upvotes: 1

Related Questions