What would be the easiest way to create a quick editor for some data in a database in WPF / WinForms, where the data is represented by a view in a SQL Server database?
Let's say I have a table Person { id int, name nvarchar(max), GenderID int, CityID int} , where GenderID and CityID are a reference to the Gender and City tables. In the editor, Person will be displayed as a text box for the name, combobox for the floor (selection of gender names from the Gender table) and the same for the city column.
Is there something easy that I can do for some control / code to generate this? If I only want to select data, then WinForms DataGridView or WPF DataGrid can generate a column for each property and show a row for each object in the collection. -
Is there some kind of magical control that could do this to represent the database if the relationships are defined by a foreign key?
It seems to me that thousands of developers have faced such a problem - quickly create a graphical interface for editing database rows with relationships to other tables, so there should be some kind of generally accepted solution. Or does everyone do it in code? Or, if there is a tool for this in another language, not C #, not Windows Forms - like dBase.
c # sql winforms
Axarydax
source share