469,950 Members | 2,361 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

student info

8
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'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
5:
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
'add
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
'show all
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








Private Sub Display_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'load
OleDbDataAdapter1.Fill(DataSet41)
DataGrid1.DataSource = DataSet41.Tables(0)

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 Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'show all

Dim obj As New datalayer
DataGrid1.DataSource = obj.BRING_DATA("select * from student where program= '" & ComboBox1.SelectedValue & " ' and specialization= '" & ComboBox2.SelectedValue & "'")


End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

'restore all
Dim obj As New datalayer
DataGrid1.DataSource = obj.BRING_DATA("select * from student")


End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'ok
Dim obj As New datalayer
DataGrid1.DataSource = obj.BRING_DATA("select * from student where name like '%" & TextBox1.Text & "%'")

End Sub
Jul 26 '06 #1
0 1452

Post your reply

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

Similar topics

6 posts views Thread by suenacita1 | last post: by
8 posts views Thread by ChrisMac | last post: by
2 posts views Thread by sallyk07 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.