I am stuck in this problem. I am creating a Windows Phone application. Here is the code.
private async void btn_signup_Click(object sender, RoutedEventArgs e)
{
obj = new ServiceReference2.Service1Client();
if (!txt_id.Text.Equals("") && !txt_name.Text.Equals("") && !txt_password.Equals(""))
{
user r = new user();
r.ID = txt_id.Text;
r.FULLNAME = txt_name.Text;
r.PASSWORD = txt_password.Text;
var g = await obj.GetDataAsync(r);
string message = g;
if (message.Equals("done"))
{
lbl_show.Text = "you have signed up !! Hurrah";
NavigationService.Navigate(new Uri("/mainmenu.xaml", UriKind.Relative));
}
else
{
lbl_show.Text = " Please fill all the field.Enter again";
}
}
}
I am getting this error "cannot await void". I am using WCF service to access the db. Please guide me with the appropriate solution.