My assignment: Purpose: Online Degrees This Windows application opens an Access database that displays information about 36 online college majors in a Windows form. The data in the database can be viewed, updated, and deleted. The application also computes the total number of students attending the college online. The user can select a major from a ComboBox list and the application will display the percentage of students participating in that major. Program Procedures: Algorithms, Processing, and Conditions: In a Windows application, the Access database file is opened and the user can view, add, and delete records as needed. The total student population and number of students in a particular major can also be displayed. 1. The user first views a Windows application that loads an Access database table, which includes fields for the department, college major, and number of students in that major. A navigation toolbar appears at the top of the Windows form, allowing the user to move from record to record. The Windows form also includes a title. 2. The user can click the Add new button on the navigation toolbar to add a new major to the online college. The record is saved when the user clicks the Save Data button on the navigation toolbar. 3. The user can click the Delete button on the navigation toolbar to delete a major. The record is permanently deleted when the user clicks the Save Data button on the navigation toolbar. 4. The user can click the Find Total Button object to compute the total number of students enrolled in each major. 5. The user can select a major from a ComboBox list and the application will display the number of students at the college participating in that major. Notes and Restrictions: Comments: The College.accdb file is located on the USB drive (the D drive). 1. The College.accdb file is available on CengageBrain.com. 2. Use a graphic image you obtain from the web My codes: Public Class frmOnlineDegree Private Sub CollegeMajorsBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles CollegeMajorsBindingNavigatorSaveItem.Click Me.Validate() Me.CollegeMajorsBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.CollegeDataSet) End Sub Private Sub frmOnlineDegree_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'CollegeDataSet.CollegeMajors' table. You can move, or remove it, as needed. Me.CollegeMajorsTableAdapter.Fill(Me.CollegeDataSet.CollegeMajors) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim strSql As String = "Select * FROM CollegeMajors" Dim StrPath As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=C:\Users\amzsa\Downloads\College.accdb" Dim odaDegree As New OleDb.OleDbDataAdapter(strSql, StrPath) Dim datValue As New DataTable Dim intcount As Integer Dim decTotalNumber As Double = 0 odaDegree.Fill(datValue) odaDegree.Dispose() For intcount = 0 To datValue.Rows.Number - 1 decTotalNumber += Convert.ToDecimal(datValue.Rows(intcount)("Number of Degree")) Next lblTotalNumber.Visible = True lblTotalNumber.Text = "The total number of students enrolled in each major is" & decTotalNumber.ToString("C") End Sub End Class a you need to do Also, after you fix that also problem, you need to fix another error with the proper name of the field that you need to add. In addition, here we are counting students, so the formatting could not be currency!!! It is just a number!!!
can anyone please help me for my coding this is Microsoft visual studio code. whenever i try to open my programing it doesn't show a combox and the total student number can anyone please check it.
My assignment:
Purpose: Online Degrees
This Windows application opens an Access
Program Procedures:
Conditions:
In a Windows application, the Access database file is opened and the user can view, add, and delete records as needed. The total student population and number of students in a particular major can also be displayed.
1. The user first views a Windows application that loads an Access database table, which includes fields for the department, college major, and number of students in that major. A navigation toolbar appears at the top of the Windows form, allowing the user to move from record to record. The Windows form also includes a title.
2. The user can click the Add new button on the navigation toolbar to add a new major to the online college. The record is saved when the user clicks the Save Data button on the navigation toolbar.
3. The user can click the Delete button on the navigation toolbar to delete a major. The record is permanently deleted when the user clicks the Save Data button on the navigation toolbar.
4. The user can click the Find Total Button object to compute the total number of students enrolled in each major.
5. The user can select a major from a ComboBox list and the application will display the number of students at the college participating in that major.
Notes and Restrictions:
Comments: The College.accdb file is located on the USB drive (the D drive).
1. The College.accdb file is available on CengageBrain.com. 2. Use a graphic image you obtain from the web
My codes:
Public Class frmOnlineDegree
Private Sub CollegeMajorsBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles CollegeMajorsBindingNavigatorSaveItem.Click
Me.Validate()
Me.CollegeMajorsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.CollegeDataSet)
End Sub
Private Sub frmOnlineDegree_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CollegeDataSet.CollegeMajors' table. You can move, or remove it, as needed.
Me.CollegeMajorsTableAdapter.Fill(Me.CollegeDataSet.CollegeMajors)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim strSql As String = "Select * FROM CollegeMajors"
Dim StrPath As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=C:\Users\amzsa\Downloads\College.accdb"
Dim odaDegree As New OleDb.OleDbDataAdapter(strSql, StrPath)
Dim datValue As New DataTable
Dim intcount As Integer
Dim decTotalNumber As Double = 0
odaDegree.Fill(datValue)
odaDegree.Dispose()
For intcount = 0 To datValue.Rows.Number - 1
decTotalNumber += Convert.ToDecimal(datValue.Rows(intcount)("Number of Degree"))
Next
lblTotalNumber.Visible = True
lblTotalNumber.Text = "The total number of students enrolled in each major is" & decTotalNumber.ToString("C")
End Sub
End Class
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images