0% found this document useful (0 votes)
121 views16 pages

Stud MGMT System

- The document describes creating a student management system using Oracle and VB.NET. It includes details on creating an Oracle table called STUDENT_INFO to store student data with various fields. It also creates a sequence and trigger for automatic roll number generation. - The VB.NET code includes classes to connect to the Oracle database and perform operations like inserting, updating, deleting and viewing student records. Forms are created for main menu options, inserting new records, updating existing records and viewing results. - Functions allow refreshing data from database to fill data tables and enable/disable fields on various forms for insert/update operations.

Uploaded by

Fenil Desai
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views16 pages

Stud MGMT System

- The document describes creating a student management system using Oracle and VB.NET. It includes details on creating an Oracle table called STUDENT_INFO to store student data with various fields. It also creates a sequence and trigger for automatic roll number generation. - The VB.NET code includes classes to connect to the Oracle database and perform operations like inserting, updating, deleting and viewing student records. Forms are created for main menu options, inserting new records, updating existing records and viewing results. - Functions allow refreshing data from database to fill data tables and enable/disable fields on various forms for insert/update operations.

Uploaded by

Fenil Desai
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

Description : - Create student management system should provide insert update

delete view. (database connection use Oracle)


-------------------------------------------------------------------------------------------------------
Oracle Table - STUDENT

SQL> CREATE TABLE STUDENT_INFO


(ROLLNO VARCHAR2(7),
FNAME VARCHAR2(15),
MNAME VARCHAR2(15),
LNAME VARCHAR2(15),
DOB DATE,
GRADUATION VARCHAR2(10),
GRAD_YEAR NUMBER(4),
GRAD_UNI VARCHAR2(30),
GRAD_PER NUMBER(5,2),
GCET_RANK_COMBINE NUMBER(4),
GCET_RANK_CATEGORY NUMBER(4),
ADDRESS VARCHAR2(50),
PHONE_LAND NUMBER(12),
PHONE_MOBILE NUMBER(12),
EMAIL VARCHAR2(30),
CATEGORY VARCHAR2(10),
CITY VARCHAR2(15))
/
Table created.

SQL> DESC STUDENT_INFO


Name Null? Type
----------------------------------------- -------- ----------------------------
ROLLNO VARCHAR2(7)
FNAME VARCHAR2(15)
MNAME VARCHAR2(15)
LNAME VARCHAR2(15)
DOB DATE
GRADUATION VARCHAR2(10)
GRAD_YEAR NUMBER(4)
GRAD_UNI VARCHAR2(30)
GRAD_PER NUMBER(5,2)
GCET_RANK_COMBINE NUMBER(4)
GCET_RANK_CATEGORY NUMBER(4)
ADDRESS VARCHAR2(50)
PHONE_LAND NUMBER(12)
PHONE_MOBILE NUMBER(12)
EMAIL VARCHAR2(30)
CATEGORY VARCHAR2(10)
CITY VARCHAR2(15)
SEQUENCE
SQL> create sequence stud_seq
2 start with 1
3 increment by 1;
Sequence created.

TRIGGER
SQL> create or replace trigger stud_trig
2 before insert on student
3 for each row
4 declare
5 k varchar2(6);
6 begin
7 select lpad(to_char(stud_seq.nextval),6,'0')
8 into k from dual;
9 :new.rollno := 'S'||k;
10 end;
SQL> /
Trigger created.

CONNECTIVITY.VB
Imports System.Data.OracleClient

Public Class Connectivity


Public conn As OracleConnection
Public constr As String = "Data Source=nccadb1;User ID=scott;Password=tiger"
Public cmd As OracleCommand
Public adapterObj As OracleDataAdapter
Public dt As DataTable
Public dr As DataRow
Public ds As DataSet
Public Sub New()
conn = New OracleConnection(constr)
conn.Open()
End Sub
Public Sub add(ByVal que As String)
cmd = New OracleCommand(que, conn)
MsgBox(cmd.ExecuteNonQuery.ToString)
End Sub

Public Sub cmdrefresh()


Dim queryup As String = "select rollno,fname,mname,lname,to_char(dob),_
graduation,grad_year,grad_uni,grad_per,gcet_rank_combine,_
gcet_rank_category,address,phone_land,phone_mobile,email,_
category,city from student_info"
cmd = New OracleCommand(queryup, conn)
adapterObj = New OracleDataAdapter(cmd)
dt = New DataTable("student_info")
adapterObj.Fill(dt)
End Sub

Public Sub cmdrefresh1()


Dim queryup As String = "select * from result_info"
cmd = New OracleCommand(queryup, conn)
adapterObj = New OracleDataAdapter(cmd)
dt = New DataTable("result_info")
adapterObj.Fill(dt)
End Sub
Public Sub newrefresh(ByVal str As String)
cmd = New OracleCommand(str, conn)
adapterObj = New OracleDataAdapter(cmd)
dt = New DataTable("result_info")
adapterObj.Fill(dt)
End Sub
End Class

MAIN FORM.VB
Imports System.Windows.Forms

Public Class mainEntry

Private Sub InsertToolStripMenuItem_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles InsertToolStripMenuItem.Click
insert.Show()
End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub

Private Sub UpdateToolStripMenuItem_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles UpdateToolStripMenuItem.Click
Update1.Show()
End Sub

Private Sub DeleteToolStripMenuItem_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click
delete1.Show()
End Sub
Private Sub SearchToolStripMenuItem_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles SearchToolStripMenuItem.Click
search1.Show()
End Sub

Private Sub ViewToolStripMenuItem_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles ViewToolStripMenuItem.Click
view1.show()
End Sub

Private Sub ResultToolStripMenuItem_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles ResultToolStripMenuItem.Click
End Sub

Private Sub ADDToolStripMenuItem_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles ADDToolStripMenuItem.Click
res_add.show()
End Sub

Private Sub UpdateToolStripMenuItem1_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles UpdateToolStripMenuItem1.Click
res_update.show()
End Sub

Private Sub ViewToolStripMenuItem1_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles ViewToolStripMenuItem1.Click
res_view.Show()
End Sub
End Class

INSERT.VB
Imports System.Data.OracleClient

Public Class insert


Dim mycon As New Connectivity

Private Sub insert_cancel_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles insert_cancel.Click

tfname.Text = ""
tmname.Text = ""
tlname.Text = ""
tadd.Text = ""
tcity.Text = ""
tcategory.Text = ""
tpland.Text = ""
tpmobile.Text = ""
temail.Text = ""
tdob.Text = ""

tgraduation.Text = ""
tgrad_year.Text = ""
tgrad_uni.Text = ""
tgrad_per.Text = ""
trank_combine.Text = ""
trank_category.Text = ""

End Sub

Private Sub insert_back_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles insert_back.Click
Me.Close()
End Sub

Private Sub insert_add_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles insert_add.Click

Dim query As String


query = "insert into student_info(fname,mname,lname,dob,_
graduation,grad_year,grad_uni,grad_per,gcet_rank_combine,_
gcet_rank_category,address,phone_land,phone_mobile,email,_
category,city) values ('" + tfname.Text + "','" + tmname.Text _
+ "','" + tlname.Text + "','" + tdob.Text + "','" +_
tgraduation.Text + "'," + tgrad_year.Text + ",'" +_
tgrad_uni.Text + "'," + tgrad_per.Text + "," + trank_combine.Text_
+ "," + trank_category.Text + ",'" + tadd.Text + "'," + tpland.Text_
+ "," + tpmobile.Text + ",'" + temail.Text + "','" + tcategory.Text _
+ "','" + tcity.Text + "')"

mycon.add(query)
End Sub
End Class

UPDATE.VB
Imports System.Data.OracleClient

Public Class Update1


Dim mycon As New Connectivity
Public Sub setenable()
tfname.Enabled = False
tmname.Enabled = False
tlname.Enabled = False
tadd.Enabled = False
tcity.Enabled = False
tcategory.Enabled = False
tpland.Enabled = False
tpmobile.Enabled = False
temail.Enabled = False
tdob.Enabled = False

tgraduation.Enabled = False
tgrad_year.Enabled = False
tgrad_uni.Enabled = False
tgrad_per.Enabled = False
trank_combine.Enabled = False
trank_category.Enabled = False
End Sub
Private Sub Update_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
mycon.cmdrefresh()
For Each mycon.dr In mycon.dt.Rows
ComboBox1.Items.Add(mycon.dr.Item("rollno"))
Next
setenable()
End Sub

Private Sub update_cancel_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles update_cancel.Click
setempty()
setenable()
End Sub
Public Sub setempty()
tfname.Text = ""
tmname.Text = ""
tlname.Text = ""
tadd.Text = ""
tcity.Text = ""
tcategory.Text = ""
tpland.Text = ""
tpmobile.Text = ""
temail.Text = ""
tdob.Text = ""

tgraduation.Text = ""
tgrad_year.Text = ""
tgrad_uni.Text = ""
tgrad_per.Text = ""
trank_combine.Text = ""
trank_category.Text = ""
End Sub

Private Sub update_back_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles update_back.Click
Me.Close()
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
setenable2()
Dim str As String = ComboBox1.SelectedItem

For Each mycon.dr In mycon.dt.Rows

If str.Equals(mycon.dr.Item("rollno")) Then
tfname.Text = mycon.dr.Item("fname")
tmname.Text = mycon.dr.Item("mname")
tlname.Text = mycon.dr.Item("lname")
tadd.Text = mycon.dr.Item("address")
tcity.Text = mycon.dr.Item("city")
tcategory.Text = mycon.dr.Item("category")
tpland.Text = mycon.dr.Item("phone_land")
tpmobile.Text = mycon.dr.Item("phone_mobile")
temail.Text = mycon.dr.Item("email")
tdob.Text = mycon.dr.Item("to_char(dob)")

tgraduation.Text = mycon.dr.Item("graduation")
tgrad_year.Text = mycon.dr.Item("grad_year")
tgrad_uni.Text = mycon.dr.Item("grad_uni")
tgrad_per.Text = mycon.dr.Item("grad_per")
trank_combine.Text = mycon.dr.Item("gcet_rank_combine")
trank_category.Text = mycon.dr.Item("gcet_rank_category")
Exit For
End If

Next
End Sub
Public Sub setenable2()
' tfname.Enabled = True
'tmname.Enabled = True
'tlname.Enabled = True
tadd.Enabled = True
tcity.Enabled = True
' tcategory.Enabled = True
tpland.Enabled = True
tpmobile.Enabled = True
temail.Enabled = True
' tdob.Enabled = True

'tgraduation.Enabled = True
'tgrad_year.Enabled = True
'tgrad_uni.Enabled = True
'tgrad_per.Enabled = True
'trank_combine.Enabled = True
'trank_category.Enabled = True
End Sub

Private Sub update_cg_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles update_cg.Click

Dim que As String = "update student_info set fname = '" + _


tfname.Text + "',mname = '" + tmname.Text + "',lname = '" + _
tlname.Text + "',address = '" + tadd.Text + "',city = '" + _
tcity.Text + "',email = '" + temail.Text + "',category = '" +_
tcategory.Text + "',phone_land = " + tpland.Text + ",phone_mobile _
= " + tpmobile.Text + ",dob = '" + tdob.Text + "',graduation = '" +_
tgraduation.Text + "',grad_uni = '" + tgrad_uni.Text + "',grad_per =_
" + tgrad_per.Text + ",grad_year = " + tgrad_year.Text + _
",gcet_rank_combine = " + trank_combine.Text + ",gcet_rank_category _
= " + trank_category.Text + "where rollno = '" + _
ComboBox1.SelectedItem + "'"

mycon.cmd = New OracleCommand(que, mycon.conn)


MsgBox(mycon.cmd.ExecuteNonQuery.ToString)
'mycon.dt.Reset()

mycon.cmdrefresh()
End Sub
End Class

SEARCH.VB
Imports System.Data.OracleClient

Public Class search1

Dim mycon As New Connectivity


Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

Dim str As String = ComboBox1.SelectedItem


DataGridView1.Enabled = True

Dim queryup As String = "select rollno,fname,mname,lname,to_char(dob),_


graduation,grad_year,grad_uni,grad_per,gcet_rank_combine,_
gcet_rank_category,address,phone_land,phone_mobile,email,category,_
city from student_info where fname = '" + ComboBox1.SelectedItem + "'"

mycon.cmd = New OracleCommand(queryup, mycon.conn)


mycon.adapterObj = New OracleDataAdapter(mycon.cmd)
mycon.dt = New DataTable("student_info")
mycon.adapterObj.Fill(mycon.dt)
DataGridView1.DataSource = mycon.dt
End Sub

Private Sub search1_Load(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.Enabled = False
mycon.cmdrefresh()
For Each mycon.dr In mycon.dt.Rows
ComboBox1.Items.Add(mycon.dr.Item("fname"))
Next
End Sub

Private Sub update_back_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles update_back.Click
Me.Close()
End Sub
End Class

DELETE.VB
Imports System.Data.OracleClient

Public Class delete1


Dim mycon As New Connectivity
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
'mycon.cmdrefresh()
'For Each mycon.dr In mycon.dt.Rows
' ComboBox1.Items.Add(mycon.dr.Item("rollno"))
'Next
Dim str As String = ComboBox1.SelectedItem

For Each mycon.dr In mycon.dt.Rows

If str.Equals(mycon.dr.Item("rollno")) Then
tfname.Text = mycon.dr.Item("fname")
tmname.Text = mycon.dr.Item("mname")
tlname.Text = mycon.dr.Item("lname")
tadd.Text = mycon.dr.Item("address")
tcity.Text = mycon.dr.Item("city")
tcategory.Text = mycon.dr.Item("category")
tpland.Text = mycon.dr.Item("phone_land")
tpmobile.Text = mycon.dr.Item("phone_mobile")
temail.Text = mycon.dr.Item("email")
tdob.Text = mycon.dr.Item("to_char(dob)")

tgraduation.Text = mycon.dr.Item("graduation")
tgrad_year.Text = mycon.dr.Item("grad_year")
tgrad_uni.Text = mycon.dr.Item("grad_uni")
tgrad_per.Text = mycon.dr.Item("grad_per")
trank_combine.Text = mycon.dr.Item("gcet_rank_combine")
trank_category.Text = mycon.dr.Item("gcet_rank_category")
Exit For
End If

Next
End Sub

Public Sub setempty()


tfname.Text = ""
tmname.Text = ""
tlname.Text = ""
tadd.Text = ""
tcity.Text = ""
tcategory.Text = ""
tpland.Text = ""
tpmobile.Text = ""
temail.Text = ""
tdob.Text = ""

tgraduation.Text = ""
tgrad_year.Text = ""
tgrad_uni.Text = ""
tgrad_per.Text = ""
trank_combine.Text = ""
trank_category.Text = ""
End Sub
Private Sub delete1_Load(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles MyBase.Load

setenable()
mycon.cmdrefresh()
For Each mycon.dr In mycon.dt.Rows
ComboBox1.Items.Add(mycon.dr.Item("rollno"))
Next
End Sub

Private Sub update_back_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles update_back.Click
Me.Close()
End Sub

Private Sub delete_del_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles delete_del.Click
Dim que As String = "delete from student_info where rollno =_
'" + ComboBox1.SelectedItem + "'"
mycon.cmd = New OracleCommand(que, mycon.conn)
MsgBox(mycon.cmd.ExecuteNonQuery.ToString)
mycon.cmdrefresh()
ComboBox1.Items.Remove(ComboBox1.SelectedItem)
setempty()
End Sub
Public Sub setenable()
tfname.Enabled = False
tmname.Enabled = False
tlname.Enabled = False
tadd.Enabled = False
tcity.Enabled = False
tcategory.Enabled = False
tpland.Enabled = False
tpmobile.Enabled = False
temail.Enabled = False
tdob.Enabled = False

tgraduation.Enabled = False
tgrad_year.Enabled = False
tgrad_uni.Enabled = False
tgrad_per.Enabled = False
trank_combine.Enabled = False
trank_category.Enabled = False
End Sub
End Class
VIEW.VB
Imports System.Data.OracleClient

Public Class view1


Dim mycon As New Connectivity
Private Sub view1_Load(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles MyBase.Load

mycon.cmdrefresh()
DataGridView1.DataSource = mycon.dt
DataGridView1.AllowUserToAddRows = False
DataGridView1.AllowUserToDeleteRows = False
DataGridView1.AllowUserToOrderColumns = False
DataGridView1.AllowUserToResizeColumns = False
DataGridView1.AllowUserToResizeRows = False
DataGridView1.ReadOnly = True

End Sub

Private Sub Button1_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles Button1.Click

Me.Close()
End Sub
End Class

Description : create result application of student management system provide


insert update, view (database connection use Oracle)
------------------------------------------------------------------------------
Oracle Table - RESULT
SQL> CREATE TABLE RESULT_INFO
(ROLLNO VARCHAR2(7),
SEM NUMBER(1),
PAPER NUMBER(3),
MARKS_INT NUMBER(5),
MARKS_EXT NUMBER(5),
PASS_YEAR VARCHAR2(15))
/
Table created.

SQL> DESC RESULT_INFO


Name Null? Type
----------------------------------------- -------- ----------------------------
ROLLNO VARCHAR2(7)
SEM NUMBER(1)
PAPER NUMBER(3)
MARKS_INT NUMBER(5)
MARKS_EXT NUMBER(5)
PASS_YEAR VARCHAR2(15)

RES_INSERT
Imports System.Data.OracleClient

Public Class res_add


Dim mycon As New Connectivity
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Dim str As String = ComboBox2.SelectedItem
str += "0"
Dim i As Int16
For i = 1 To 6
ComboBox3.Items.Add((str + i.ToString))
Next
End Sub

Private Sub res_add_Load(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles MyBase.Load
mycon.cmdrefresh()
For Each mycon.dr In mycon.dt.Rows
ComboBox1.Items.Add(mycon.dr.Item("rollno"))
Next
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles Button2.Click

tm1.Text = ""
tm2.Text = ""
tpass.Text = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click

Dim query As String


query = "insert into result_info(rollno,sem,paper,_
marks_int,marks_ext,pass_year) values ('" + ComboBox1.SelectedItem_
+ "'," + ComboBox2.SelectedItem + "," + ComboBox3.SelectedItem +_
"," + tm1.Text + "," + tm2.Text + ",'" + tpass.Text + "')"
mycon.add(query)
End Sub
End Class

RES_UPDATE
Imports System.Data.OracleClient

Public Class res_update


Dim mycon As New Connectivity
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Dim str As String = ComboBox2.SelectedItem
ComboBox1.Enabled = False
str += "0"
Dim i As Int16

ComboBox3.Items.Clear()

For i = 1 To 6
ComboBox3.Items.Add((str + i.ToString))
Next
ComboBox3.Enabled = True
End Sub

Private Sub res_add_Load(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles MyBase.Load
mycon.cmdrefresh1()
For Each mycon.dr In mycon.dt.Rows
ComboBox1.Items.Add(mycon.dr.Item("rollno"))
Next
ComboBox2.Enabled = False
ComboBox3.Enabled = False
tm1.Enabled = False
tm2.Enabled = False
tpass.Enabled = False
Button1.Enabled = False

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

Public Sub myempty()


tm1.Text = ""
tm2.Text = ""
tpass.Text = ""
End Sub
Private Sub Button2_Click(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles Button2.Click
myempty()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, _


ByVal e As System.EventArgs) Handles Button1.Click

Dim query As String


query = "update result_info set marks_int = " + tm1.Text + _
",marks_ext = " + tm2.Text + ",pass_year = '" + tpass.Text + _
"' where rollno = '" + ComboBox1.SelectedItem + "'and sem = " +_
ComboBox2.SelectedItem + " and paper = " + ComboBox3.SelectedItem
mycon.add(query)
ComboBox1.Enabled = True
ComboBox2.Enabled = False
ComboBox3.Enabled = False
tm1.Enabled = False
tm2.Enabled = False
tpass.Enabled = False
Button1.Enabled = False
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
ComboBox2.Enabled = True
End Sub

Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
ComboBox2.Enabled = False
tm1.Enabled = True
tm2.Enabled = True
tpass.Enabled = True
myempty()
Dim str As String = ComboBox1.SelectedItem
Dim queryup As String = "select * from result_info where rollno = '"_
+ ComboBox1.SelectedItem + "'and sem = " + ComboBox2.SelectedItem + " _
and paper = " + ComboBox3.SelectedItem
mycon.newrefresh(queryup)
For Each mycon.dr In mycon.dt.Rows

If str.Equals(mycon.dr.Item("rollno")) Then
tm1.Text = mycon.dr.Item("marks_int")
tm2.Text = mycon.dr.Item("marks_ext")
tpass.Text = mycon.dr.Item("pass_year")
Exit For
End If
Next
End Sub
Private Sub tpass_TextChanged(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles tpass.TextChanged
If tpass.Text = "" Then
Button1.Enabled = False
Else
Button1.Enabled = True
End If
End Sub
End Class

RES_VIEW
Imports System.Data.OracleClient
Public Class res_view
Dim mycon As New Connectivity
Private Sub view1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
mycon.cmdrefresh1()
DataGridView1.DataSource = mycon.dt
DataGridView1.AllowUserToAddRows = False
DataGridView1.AllowUserToDeleteRows = False
DataGridView1.AllowUserToOrderColumns = False
DataGridView1.AllowUserToResizeColumns = False
DataGridView1.AllowUserToResizeRows = False
DataGridView1.ReadOnly = True
End Sub

Private Sub Button1_Click(ByVal sender As System.Object,_


ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class

You might also like