473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Students-MainForm

(First Import files i.e.:Imports System.data.OleDb

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim objconn As New OleDbConnection("PROVIDER=MICROSOFT.JET.OLEDB.4.0; Data Source=c:\IQRA.mdb")
Dim objda_prog As New OleDbDataAdapter("select distinct program from program", objconn)
Dim objDA_majors As New OleDbDataAdapter("select distinct majors from majors", objconn)
Dim objds_prog As New DataSet
Dim objds_majors As New DataSet

objda_prog.Fill(objds_prog, "program")
objDA_majors.Fill(objds_majors, "majors")

ComboBox1.DataSource = objds_prog.Tables("program")
ComboBox1.DisplayMember = "program"
ComboBox1.ValueMember = "program"

ComboBox2.DataSource = objds_majors.Tables("majors")
ComboBox2.DisplayMember = "majors"
ComboBox2.ValueMember = "majors"

End Sub

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

Dim objconn As New OleDbConnection("PROVIDER=MICROSOFT.JET.OLEDB.4.0; Data Source=c:\IQRA.mdb")
Dim objcmd As New OleDbCommand("INSERT into student (name, program, specialization, shift) values ( '" & TextBox2.Text & "', '" & ComboBox1.SelectedValue & "', '" & ComboBox2.SelectedValue & "', '" & ComboBox3.Text & "')", objconn)
Dim OBJDR As OleDbDataReader

objconn.Open()
objcmd.ExecuteNonQuery()

MsgBox("Record Successfully Added")
objconn.Close()

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim Second As New Display
Second.Show()

End Sub
End Class
Jul 26 '06 #1
0 886

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Will | last post by:
I have a 3 main tables, tblStudent, tblEnrolled and tblCourse. I have an unmatched query which will tell me which students are not enrolled for a specific course. I also have an unmatched query...
14
by: glitter boy | last post by:
Ok so I have this class for C. I have to write this program for my instructor, where he has already posted the softcopy and algorithm. But my question is I have to convert meters to feet and in...
10
by: Jim Bayers | last post by:
We need to stop students from clicking on the form button more than once. We have a form that students fill out with their credit card information. They click, the form sends the data in xml to...
2
by: Arnold | last post by:
For some of my secondary students studying bits and bytes, I'd like to make a form in which they can create secret codes with bytes. I'd like the form to have a memo field that can only accept 0s...
17
by: JunDa.Huang | last post by:
I am a university student, How to study program language well ?
4
by: Dave White | last post by:
Hello everyone, I would like to assign a lesson to many students as a group rather than individually. Any suggestions would be appreciated. Dave White
1
by: jonkemm | last post by:
I'm making a a system for my school to allow students to have some online space to store their school files on. It has a basic upload / create folder / download / delete bit, it also has a 'submit...
2
by: =?Utf-8?B?am9lb2ppaA==?= | last post by:
Most students do not have enough time to do their homeworks, assignments, college papers, etc alone. Also most of them, even though they know what to do with respect to their writing assignment,...
13
by: Eric IsWhoIAm | last post by:
I have four tables created so far: Courses, Instructors, Courses and Instructors (which shows the Course and Instructor Name fields, but holds their IDs since those are the keys), and Students....
1
by: roxys | last post by:
Hello, I was wondering if someone could help me a bit here. Im trying to desing an electronic university students enrollement system. The system requirements are as follows: 1.Students can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.