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

Hello, I am a BEGINNER using Microsoft Visual Studio as my coding program. This

ID: 3821720 • Letter: H

Question

Hello, I am a BEGINNER using Microsoft Visual Studio as my coding program. This project comes from the "Microsoft Visual Basic 2015 RELOADED" book, chapter 12, page 654, case project College Courses.

Here is the problem:

In this Case Project, you use a Microsoft Access database named Courses. The database is stored in the VbReloaded2015Chap12Access DatabasesCourses.accdb file. The database contains one table named tblCourses. Each record has the following four fields: ID, Title, CreditHours, and Grade. The CreditHours field is numeric; the other fields contain text. Create an application that allows the user to display the records for a specific grade (A, B, C, D, or F). The user should also be able to display all of the records. Display the records in a DataGridView control. The application should not allow the user to add, edit, delete, or save records. Include
a Calculate GPA button on the BindingNavigator control. The button’s Click event procedure should display the student’s GPA. An A grade is worth 4 points, a B is worth 3 points, and so on. Use the following names for the solution and project, respectively: College Courses Solution and College Courses Project. Save the application in the VbReloaded2015Chap12 folder. Change the form file’s name to Main Form.vb.

Here is the Access file:

I have to use Microsoft Visual Studio as my coding program and I am a BEGINNER.
Thank you very much for your help/work with this problem!

tblCourses Credit Hours Grade Click to Add Title CS100 Introduction to Computers 3 A CS106 Windows Seminar 2 B 3 B Visual Basic CS204 EN100 3 A. English Composition EN104 Speech 2 B 3 C HS100 History 2 F PE100 Health Golf 2 A PE101 3 D PS100 Political Science Sociology 3 C S0100

Explanation / Answer

First we must add the following declaration

Public Class Form1

    Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=VbReloaded2015Chap12Access DatabasesCourses.accdb"

    Dim MyConn As OleDbConnection

    Dim da As OleDbDataAdapter

    Dim ds As DataSet

    Dim tables As DataTableCollection

    Dim source1 As New BindingSource

Then on the click of the Button

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        MyConn = New OleDbConnection

        MyConn.ConnectionString = connString

        ds = New DataSet

        tables = ds.Tables

        da = New OleDbDataAdapter("Select * from [items]", MyConn) 'Change items to your database name

        da.Fill(ds, "items") 'Change items to your database name

        Dim view As New DataView(tables(0))

        source1.DataSource = view

        DataGridView1.DataSource = view

End Sub

Public Class Form1

    Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=VbReloaded2015Chap12Access DatabasesCourses.accdb"

    Dim MyConn As OleDbConnection

    Dim da As OleDbDataAdapter

    Dim ds As DataSet

    Dim tables As DataTableCollection

    Dim source1 As New BindingSource

Then on the click of the Button

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        MyConn = New OleDbConnection

        MyConn.ConnectionString = connString

        ds = New DataSet

        tables = ds.Tables

        da = New OleDbDataAdapter("Select * from [items]", MyConn) 'Change items to your database name

        da.Fill(ds, "items") 'Change items to your database name

        Dim view As New DataView(tables(0))

        source1.DataSource = view

        DataGridView1.DataSource = view

End Sub

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote