Question: In this exercise, you create a two - table SQL Server database. You also create an application that displays the database information in a DataGridView

In this exercise, you create a two-table SQL Server database. You also create an application that displays the database information in a DataGridView control. (F11.1F11.7, F11.10)
a. Create a Windows Forms application. Use the following names for the project and solution, respectively: Global Project and Global Solution. Save the application in the VB9e\Chap11 folder.
b. Create a SQL Server database named Global.mdf. Add the Salespeople table definition and records shown in Figure 11-70 to the database. Remember to click the Update button and then click the Update Database button after defining the table. Then, add the Sales table definition and records shown in Figure 11-71 to the database.
c. Open the Data Sources window and start the Data Source Configuration Wizard. Connect the Global.mdf file to the application. Include both tables in the dataset.
d. Open the DataSet Designer window by right-clicking GlobalDataSet in the Data Sources window and then clicking Edit DataSet with Designer. Add a relation to the window. Relate both tables by the SalesId field. (The Salespeople table is the parent table, and the Sales table is the child table.)
e. Right-click Fill,GetData() in the SalespeopleTableAdapter box and then click Configure. Open the Query Builder dialog box. Add the Sales table to the Diagram pane. The application will need to display the SalesId and Name fields from the Salespeople table along with the Sales field from the Sales table. Select the appropriate check box(es). Execute the query to verify that it retrieves the required information. Then, close the Query Builder dialog box and continue configuring the Fill and GetData methods.
f. Save the solution and then close the GlobalDataSet.xsd window.
g. Use the DataGridView tool, which is located in the Data section of the toolbox, to add a DataGridView control to the form. Drag the appropriate object from the Data Sources window to the control.
h. The DataGridView control should not allow the user to add, edit, or delete records. When the application is started, its interface should appear similar to the one shown in Figure 11-72. Save the solution and then start and test the application.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!