Search record in two tables not related to a single query from a textbox in c # with sql-server

0

I have trouble searching for records through a textbox.

I have two tables, one called mother and the other parent, and I need to search from a third table called proxy, through a textbox with the rut, the record of who will be the proxy, which may be the father or the mother.

the structures of the tables are:

CREATE TABLE Padre  
(  
    id_RutP varchar(11) primary key ,  
    Nombre_padre varchar(50),  
    Nacionalidad varchar(50),  
    Direccion varchar(50),  
    id_comuna int FOREIGN KEY REFERENCES Comuna(id_comuna),  
    Nivel_educ varchar(50),  
    Ocupacion varchar(50),  
    Fono int,  
    id_parentezco int FOREIGN KEY REFERENCES Parentezco(id_parentezco),  
    Mail Varchar(50)  
);  

CREATE TABLE Madre  
(    
    id_RutM varchar(11) primary key ,  
    Nombre_padre varchar(50),  
    Nacionalidad varchar(50),  
    Direccion varchar(50),  
    id_comuna int FOREIGN KEY REFERENCES Comuna(id_comuna),  
    Nivel_educ varchar(50),  
    Ocupacion varchar(50),  
    Fono int,  
    id_parentezco int FOREIGN KEY REFERENCES Parentezco(id_parentezco),  
    Mail Varchar(50)  
);  

CREATE TABLE Apoderado  
(  
    id_Rut varchar(11) primary key ,  
    Nombre_persona varchar(50),  
    Nacionalidad_P varchar(50),  
    Direccion varchar(50),  
    id_comuna int FOREIGN KEY REFERENCES Comuna(id_comuna),  
    Nivel_educ varchar(50),  
    Ocupacion varchar(50),    
    Fono int,  
    id_parentezco int FOREIGN KEY REFERENCES Parentezco(id_parentezco),  
    Mail Varchar(50),  
    Rut_id varchar(11) FOREIGN KEY REFERENCES Estudiantes(Rut_id)  
);  

And I need to fill in the other textbox with the data found and then associate a student through the combobox to save it using a save button.

    
asked by Veugev 23.12.2018 в 17:06
source

0 answers