Click here to Skip to main content
16,019,983 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,
I have on a wpf window several combo boxes and would like to add only one function, but I hang at the handover of the Table / Query from the contents to be read.

C#
private void pFillCBO(ComboBox comboBoxName, string strMember, string strValue)
            using (conString = new Entities())
            {
                comboBoxName.ItemsSource  = conString.XXXXX.ToList();
                comboBoxName.DisplayMemberPath = strMember;
                comboBoxName.SelectedValuePath = strValue;
            }


Is it at all that I can pass the table?

Thanks
Ralf

What I have tried:

I had test with different methods example Dataset as variable
Posted
Updated 4-Jun-16 4:52am
Comments
CHill60 4-Jun-16 10:49am    
Could you try explaining the problem in a different way? I'm unable to work out what the problem is

1 solution

The XXX is the table in the database.
How can I pass when calling?

Perhaps
pFillCBO(cboTest, "cntNr", "Title", DATABASE TABLE);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900