In my selectUser class I have:
public checkEmail(string email)
{
peopleTableAdapters.PeoplesTableAdapter p = new peopleTableAdapters.PeoplesTableAdapter();
return p.checkEmail(email);
}
In the client side code I have:
protected void Button1_Click(object sender, EventArgs e)
{
selectUser s = new selectUser();
try
{
s.checkEmail(email.Text);
}
catch(Exception e)
{
}
}
I am getting this error with the "return p.checkEmail(email);" the error is:
"Error 307 Since 'authentication.checkEmail(string)' returns void, a return keyword must not be followed by an object expression"
Does anyone understand what I am doing wrong?
I dont want to return any data because its not needed I just want to return something so it succeeds in the try statement.
Method (.....) must have a return typeSelectUser selectUser = new SelectUser(). If you stick to that rule, you will soon find that it is much more easier to read such code.