Fast way to code forms in C# which is bind to SQL data
I am coming from MS-ACESS world and their progr开发者_如何学JAVAaming habits, There was nice utility to make form from table, You can simply hit right click on table and make form for it. Now I looking for something similar for Visual Studio and WinForms. I am trying to develop simple application for which I need to have more then 30 forms for handling data, till now I designed database tables, keys and sprocs in SQL2008 and before I start coding forms for handling data, I asking You for main guidelines how to save my time while coding forms.
Click in VS2008 within the menu bar on Data - Show Data Sources.
In the new window you can select the first icon in the top left to create a new dataSource by help from a wizard.
Just step through it and select the database, tables, views, etc. you like.
When you're finished in the wizard, you can drag and drop the tables from the Data Sources window onto your form. You can also before drag and drop something click on the icon next to the table, view, etc. and change the container type which should be auto-generated.
Starting with these tips it should be quite easy to get a first version to run.
Last but not least:
These wizards create normal code files, which can be viewed and editing like any self written code file. So you can also take a look there to find out which base classes are needed to get all these thing to work to know how you can do some special task manually on yourself.
a simple way is to use a typed dataset (generated by vs) and to bind that to a datagridview.
精彩评论