• Home
  • Blog
  • Resolving Table Parameter Unspecified Issue

Resolving Table Parameter Unspecified Issue

0 comments

Hi, I am fairly close to finishing a task but I have a slight issue regarding table parameters being unspecified in my code. I am creating a web application that using a database.

This action in the controller aims to filter the results by the persons hair colour.

  /// POST: /Person/Search
  [HttpPost]
  public ActionResult Search(PersonSearchViewModel viewModel)
  {
  viewModel.HairColourViewModel = new HairColourViewModel
  {
  HairColours = new SelectList(this.hairColourManager.GetHairColours(),
“HairColour”),
 
  };

  if (!this.ModelState.IsValid)
  {
  return this.View(viewModel);
  }

  viewModel.SearchResult = this.personManager.FindPeople(viewModel.SearchCriteria, 1234);

  return this.View(viewModel);
  }

The procedure (database):

create procedure akk.GetPersonalDetails
  @Age int  = null,
  @Birthdate  date  = null,
 
@HairColourCategory akk.IdTableType readonly  — Optional list of
Person ids to filter by. Passing none will be treated as if all
were passed.

The table (database):

create type akk.IdTableType as table
(
  Category int
)

All steps work up until here work, but when I try to search for the person by their hair colour, I get the error “Table parameter is unspecified” .

If you could tell me what this means I would be very grateful.

Thankyou

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}