Novice working with the Head First eBook C# Programming. An exercise that requires the creation of a contacts database also requires additional controls. According to the text, a designer views is required for the drop down arrow to appear
Have not been able to find the correct set of steps to acheive this view. Have done so successfully with Visual Studio 2008 Team System. Guidance sought
You first need to add a database as a data source, before it can appear in the Data Sources window. So after the connection is made, go to Data Sources window (Data menu -> Show Data Sources) and select "Add New Data Source..." (icon, right-click, or from the Data menu). When the wizard appears, choose Database as the data source type, then click Next. You should be presented with an option to pick a database model - if so, pick Dataset. Then pick a database from the dropdown and finish the wizard.
Now you should have a dataset node visible in the Data Sources window (the one on your image above). Now, what did all this do? It created a set of classes/objects that help your C# code interact with the database (that is, it created a model of the database).
OK. Now, the "People" entry shown up there is a database table. You should now be able to use the dropdown menu on it (the one circled in the picture). But, use it before you drag the table onto the form. Experiment a bit with the two options. If you choose "DataGridView", it will put a DataGridView control on your form and set up the data set as it's data source. A DataGridView is a control that displays all rows and all columns of a table in a grid, similar to what you'd see in Excel or Access. The other option, the one used in the book, is "Details", which will instead put a bunch of labels and textboxes on your form, one for each column, and a navigator tool strip, so that you can display one row at a time. All the textboxes will be bound to their corresponding columns in the table.
Last edited by TheGreatCthulhu; June 24th, 2012 at 04:10 PM.