Populate a listview with 2 BO


Author
Message
David Daragon
David Daragon
StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)StrataFrame Novice (88 reputation)
Group: Forum Members
Posts: 54, Visits: 249
Hi,

I have a listview in my form.

I succeed to populate it with this method:

public void RecupererToutesVilles()
{
SqlCommand _maRequeteSQL = new SqlCommand();

_maRequeteSQL.CommandText = "SELECT Pk_DaVille, Libelle, CodePostal, Fk_DaPays, PhxLibelle, MajLibelle FROM L_DaVille";
this.FillDataTable(_maRequeteSQL);
}

But in my listview, I have a foreign key of a country whereas I want to see the name of the country.
So I want my query to be like these.

_maRequeteSQL.CommandText = "SELECT Pk_DaVille, L_DaVille.Libelle, CodePostal, Fk_DaPays, F_DaPays.Libelle, L_DaVille.PhxLibelle, L_DaVille.MajLibelle FROM L_DaVille INNER JOIN F_DaPays ON (L_DaVille.Fk_DaPays = F_DaPays.Pk_DaPays)";

I tried to add a display field called F_DaPays.Libelle in the PopulationDataSourceSettings but I have an error.

Can someone help me please.
Regards,

David

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search