Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please I need a Visual Basic code for this 26 Extra exercises for Murach\'s Visu

ID: 3704963 • Letter: P

Question

Please I need a Visual Basic code for this
26 Extra exercises for Murach's Visual Basic 2015 Extra 14-2 Create a Product Maintenance application In this exercise, you'll create an application that uses a data source and text boxes to maintain the products in the Products table of the MMABooks database 2 Product Produ Cade . Start a new project named ProductMaintenance in the Extra Exercises Chapter 14 ProductMMaintenance directory Add the MMABooks mdf file in the Extra Exercises Database directory to the project Then, use the Data Source Configuration Wizard to create a data source that includes the ProductCode, Description, and UnitPrice columans from the Products table. When you're done, set the "Copy to Output Directory" property of the MMABooks mdf file to "Copy if Newer 2. 3. Display the Data Sources window, and then associate the columns in the Products table of the data source you just created with indavidual controls 4. Drag the Products table onto the default form to add a text box for each column 5. Set the properties of the form and coatrols so they appear as shown above. 6. Test the application to be sure it works cosrectly

Explanation / Answer

//The code is not written completely but i have written the code from the learning perspective whcih should help in //completing the assignment.Explained the step by step action to be taken to complete the code.Some code may not //be required so it can be removed.

Step 1:

The table shall comprise of the following fields:

1.Product Code

2.Description

3.Unit Price

Step 2:

Step 2 : Inserting controls into Form

The next step is to insert some relevant controls into the form for displaying and manipulating the data of the database. The controls to be inserted are ADO controls, DataGrid controls, FlexGrid control and various command buttons. DataGrid controls and FlexGrid controls are used to display and store the data from the database tables. On the other hand, ADO is used to manipulate the database such as connecting the DataGrid and FleGrid to the database.

. As ADO is ActiveX-based, it can work in different platforms (different computer systems) and different programming languages. Besides, it can access many different kinds of data such as data displayed in the Internet browsers, email text and even graphics other than the usual relational and non relational database information.

To be able to use ADO data control, you need to insert it into the toolbox. To do this, simply press Ctrl+T to open the components dialog box and select Microsoft ActiveX Data Control 6. After this, you can proceed to build your ADO-based VB database applications.

In our example, we insert one ADO control named it as AdoProduct . We also insert one DataGrid controls and named it as AdoProductInventory . They are use to display the data to the user. Besides, we insert one FlexiGrid control to store the data and also to print out the data by connecting it to MS Excel spreadsheet.

Step 3 : Writing the Code

After inserting the necessary controls, it is time to write code to coordinate the controls and to manipulate the data. The first most important code for our program is to connect the ADO controls to the database when the form is loaded. The code is as shown below:

Private Sub Form_Load()
'To connect AdoProductInventory to database MMABooks.mdb

connection = New SqlConnection("Data Source=.SQLEXPRESS; Integrated Security=True;AttachDbFilename=|DataDirectory|MMABooks.mdf")

connection.Open()