2
Answers

a return keyword must not be followed by anobject expression

Sivakumar

Sivakumar

9y
913
1
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)