.NET Framework Developer Center >
.NET Development Forums
>
.NET Base Class Library
>
how to generate forms automatically from a sql server database table in C# ?
how to generate forms automatically from a sql server database table in C# ?
- thanks for your attention and time.
Kindly guide me how I can generate forms (windows and web as well) automatically based on a database table.
thanks in anticipation,
haansi- Moved byTaylorMichaelLMVP, ModeratorTuesday, November 03, 2009 2:22 PMNot IDE related (From:Visual C# IDE)
Answers
- Not possible as far as I know. We have custom controls for such behavior that reads the fields dynamically and shows the right controls (checkbox for boolean, textfield for text, etc). However, we also use an entity framework (not the ADO.NET one) between the data and the actual control.
Geert van Horrik - CatenaLogic
Visit my blog: http://blog.catenalogic.com
Looking for a way to deploy your updates to all your clients? Try Updater!- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:41 AM
All Replies
- For Windows Forms: use the Windows Forms DataGrid control
For Web: use the web DataGrid control
In other words, always use the DataGrid control for the right technique (WPF has a DataGrid control as well, even though it is located in the WPF toolkit.
Geert van Horrik - CatenaLogic
Visit my blog: http://blog.catenalogic.com
Looking for a way to deploy your updates to all your clients? Try Updater! - thanks Geert,
I meant to ask is there any way that form can be auto generated like by some wizard and programmer donot have to desing forms ?
In your mentioned ways I thing it will not possible we will have to design forms
thanks - Did you take a look at the part "Default Functionality in the Windows Forms DataGridView Control"?
Quote:
When you bind a DataGridView control to a data source by setting its DataSource property, the control:
-
Automatically uses the names of the data source's columns as the column header text.
-
Is populated with the contents of the data source. DataGridView columns are automatically created for each column in the data source.
-
Creates a row for each visible row in the table.
-
Automatically sorts the rows based on the underlying data when the user clicks a column header.
Geert van Horrik - CatenaLogic
Visit my blog: http://blog.catenalogic.com
Looking for a way to deploy your updates to all your clients? Try Updater! -
- Thanks Geert van Horrik for prompt replay.
I got your point now but actually I was asking for generating forms. Your are right grid creates columsn automatically but I meant to ask forms for talking input.
Thanks
haansi
- Not possible as far as I know. We have custom controls for such behavior that reads the fields dynamically and shows the right controls (checkbox for boolean, textfield for text, etc). However, we also use an entity framework (not the ADO.NET one) between the data and the actual control.
Geert van Horrik - CatenaLogic
Visit my blog: http://blog.catenalogic.com
Looking for a way to deploy your updates to all your clients? Try Updater!- Marked As Answer byeryangMSFT, ModeratorMonday, November 09, 2009 7:41 AM


