Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

 

Simple example of how to load a small table into a WPF combobox as data

 

Code Example C #

 

public void Load_Combobox()

{

    //----------------< Load_Combobox() >-----------------

    //< get_Database_Table_Data >

    //*all Data from a table

    List<tblBase_Revisionsgruende> data = db.tblBase_Revisionsgruende.ToList();

    //</ get_Database_Table_Data >

 

    CbxRevisionsgrund.ItemsSource = data;

    CbxRevisionsgrund.DisplayMemberPath = "Revisionsgrund";

    CbxRevisionsgrund.SelectedValuePath = "IDRevision";

 

    //----------------</ Load_Combobox() >-----------------

}

 

 

 

 

Simplest example of how to load a small table with EF Linq Entity Framework

 

List<tblBase_Revisionsgruende> data = db.tblBase_Revisionsgruende.ToList();

* Access and conversion is automatic and does not require a Select or WHERE command

 

Table as basis

The complete data of a small master data table is loaded

Here is the data table

 

Table

Master Data Tabell with Few Entries

 

ID

Revisionsgrund

Kurz

Farbe

Textfarbe

 

 

1

Reparatur

R

#c8e0f7

#000000

NULL

NULL

2

Umbau

U

#abd4fc

#000000

NULL

NULL

3

Abgeschaltet

A

#cc8a8a

#000000

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

NULL

 

Dropdown List

Mobile
»
WPF Combobox: Dynamically adjust the color of rows
»
Linq Combobox: Download dropdown list of data from a table

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de