Answered step by step
Verified Expert Solution
Question
1 Approved Answer
* * In Visual Basic In this exercise, you create a two - table SQL Server database. You also create an application that displays the
In Visual Basic
In this exercise, you create a twotable SQL Server database. You also create an application that displays the database information in a DataGridView control. FF F
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 VBeChap folder.
b Create a SQL Server database named Global.mdf Add the Salespeople table definition and records shown in Figure 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 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 rightclicking 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 Rightclick 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 boxes 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 Save the solution and then start and test the application.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started