Sivakumar

Sivakumar

  • NA
  • 551
  • 210.1k

a return keyword must not be followed by anobject expression

Sep 24 2015 8:12 AM
Hi,
 
This is my code :
 
  public void CreateTeam(int teamid, string teamname,byte teamstatus)
{
Team team = new Team();
team.TeamID = teamid;
team.TeamName = teamname;
team.TeamStatus = teamstatus;
return _DataContext.Teams.InsertOnSubmit(team);

}
Then it shows an error like this :
 
Error 1 Since 'Kiwi.Service.DL.DataAccess.CreateTeam(int, string, byte)' returns void, a return keyword must not be followed by an object expression D:\Source Control\Kiwi\source\Service\Kiwi.Service.DL\DataAccess.cs 160 9 Kiwi.Service.DL
 
Please resolve this error

Answers (2)