I have this error in my code:
try
{
localhost.Agendamento a = new localhost.Agendamento();
a.Cliente.Cpf = "1909009921";
a.Servico.Cod_serv = 1;
a.Data = Convert.ToDateTime("11/02/2017");
a.Hora = Convert.ToDateTime("11:50");
Service1 sv = new Service1();
sv.CadastrarAgendamento(a);
MessageBox.Show("Cadastrou!");
}catch(Exception ex)
{
MessageBox.Show("Error" + ex.Message);
}
O the exception active when it arrives on the line
a.Cliente.Cpf = "1909009921";
The exception that gives is "Object reference not set to an instance of an object"