Adding a List to SQL database (Entity Database) I got a database with members, each member has a list of sports they do.
now I want to loop through a listbox and add every selected item to my database.

This is my database : 



And this is my code : 

foreach (var item in sportCheckedListBox.CheckedIndices)
            {
                int sportindex = Convert.ToInt32(item.ToString()) + 1;
                var queryResult = from sp in context.Sports
                                  where sp.sportnr == sportindex
                                  select sp;
                foreach (var sport in queryResult)
                {
                    myMember.Sports.Add(sport);
                }
            }


This looks kinda 'shady', how could I do this better ?
You're doing a lot of unnecessary iterating with your nested for loops. I would suggest using CONTAINS over a list of ints for your SQL query, this will eliminate your outer loop. Your inner loop is adding each individual item whereas you can use AddRange to just add them all. 

//Generate a List of Integers from your Indices:
int[] indexes = myCheckedListBox.CheckedIndices.Cast&lt;int&gt;().ToArray()

//Use that list of Integers to get your list of Sports Objects
var queryResult = from sp in context.Sports 
                  where indexes.Contains(sp.sportnr)

//Add your results. 
myMember.Sports.AddRange(queryResult);