Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change the column name of datagridview in c#?
    primarykey
    data
    text
    <p>In my database i am 5 tables with names 'children' , 'personal' , 'spouse' , 'occup_contact' , 'res_contact' with column name </p> <pre><code>children(pid,pnochild,pcname,pcblood,pcdob) occup_contact(pid,poccup_nature,poccup_type,poccup_add,pemail,poccup_phone,poccup_mobile) personal(pid,pname,pfname,pmname,pfhname,pdob,pgender,pedulvl,pedu,pblood,gotra,panth,pmarritalstatus) res_contact (pid,pres_add,pres_phone,pres_mobile) spouse (pid,psname,psedulvl,psedu,psblood,psdob) </code></pre> <p>then on my form i dragged a data grid view in that i want to join results of all these these tables with modified column name like for </p> <pre><code>name not 'pname' it should be Name fathername not 'pfname' it should be Father's Name........so on </code></pre> <p>and which select statement should i use to get join result of all tables based on the name of the person i.e. <strong>pname column of personal table where pid column of personal table is the primary key and used as foreign key in all other tables. All tables are dependent on personal table</strong></p> <p>I have used this </p> <pre><code> cmd.CommandText = "select p.pname as 'Name',p.pfname as 'Father Name' ,p.pmname as 'Mother Name',p.pfhname as 'Family Head Name',p.pdob as 'Date of Birth',p.pgender as 'Gender',p.pedulvl as 'Education',p.pedu as 'Degree',p.pblood as 'Blood Group',p.gotra as 'Gotra',p.panth as 'Panth',p.pmarritalstatus as 'Marrital Status',s.psname as 'Spouse Name',s.psedulvl as 'Spouse Edu. Degree',s.psedu as 'Spouse Education',s.psblood as 'Spouse Blood Group',s.psdob as 'Spouse Date of Birth',c.pnochild as 'Number of Children',c.pcname as 'Child Name',c.pcblood as 'Child Blood Group',c.pcdob as 'Child Date of Birth',r.pres_add as 'Resident Address',pres_phone as 'Resident Ph.no ',pres_mobile as 'Resident Mobile no.',o.poccup_nature as 'Nature of Occupation',o.poccup_type as 'Type of Occupation',o.poccup_add as 'Office Address',o.pemail as 'Email id',o.poccup_phone as 'Office Ph.no',o.poccup_mobile as 'Office Mobile number'from personal as p join spouse as s on p.pid=s.pid join children as c on p.pid=c.pid join occup_contact as o on p.pid=o.pid join res_contact as r on p.pid=r.pid where pname='" + viewtxt.Text + "' "; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload