My database, db, has “Executor” as the primary key with the foreign key “CdTitle”, in one form the user can enter information to add to the database, in another form I have a combo box that I want to fill with the names artist in the database, primarily "Artist.Names". I tried using LINQ to move the database and put the query results in combobox, but it does not work as I thought.
The code I have is:
var ArtistNames = from name in formByArtist.db.Artists select name.Name; foreach (var element in ArtistNames) { comboBox1.Items.Add(element.ToString()); }
source share