public void Cargar(string CurpAux) { using (testEntities5 db = new testEntities5()) { var lstedit = new List <Get_Usr_Result>(); lstedit = db.Get_Usr(cURP: CurpAux).ToList(); var aux = lstedit.ElementAt(0); txtCalleN.Text = aux.Calle_y_Numero; txtColonia.Text = aux.Colonia; txtDelegaionM.Text = aux.Delegacion_Municipio; txtENacimiento.Text = aux.Estado_de_Nacimiento; txtEstadoC.Text = aux.Estado_Ciudad; txtPApellido.Text = aux.Primer_Apellido; txtPNombre.Text = aux.Nombre; txtSApellido.Text = aux.Segundo_Apellido; txtSNombre.Text = aux.Nombre; comboBox1.Text = aux.Sexo; maskedTextBox1.Text = aux.Telefono; var auxdate = aux.Fecha_de_Nacimiento; dateTimePicker1.Value = Convert.ToDateTime(aux.Fecha_de_Nacimiento); } }