Wednesday, August 26, 2009

Student Info System --> Course Screen Fully Working..




create table course_details(
course_code vARCHAR2(10),
COURSE_NAME vARCHAR2(100),
COURSE_DESC vARCHAR2(500),
nO_OF_SEM NUMBER(3),
aPP_YR NUMBER(5),
IMP_SUB vARCHAR2(500),
MAX_STUD NUMBER(3));

create or replace procedure insert_COURSE_details ( IN_CRS_code varchar2, in_CRS_nm varchar2, in_CRS_DESC varchar2, in_NO_OF_SEM number, in_APP_yr number, in_IMP_SUB varchar2, in_MAX_STUD numbeR) is
begin
insert into COURSE_details values(IN_CRS_code , in_CRS_nm , in_CRS_DESC , in_NO_OF_SEM , in_APP_yr , in_IMP_SUB , in_MAX_STUD );
end;

On the Submit Buttton Click

cmd.CommandType = CommandType.StoredProcedure
'cmd.CommandText = "insert into student_details (register_no, F_NAME,M_NAme,L_Name) values ('" & str1 & "' ,'" & Me.TextBox1.Text & "','" & Me.TextBox2.Text & " ',' " & Me.TextBox3.Text & "')"
cmd.CommandText = "insert_COURSE_details "
Dim IN_CRS_code, in_CRS_nm, in_CRS_DESC, in_NO_OF_SEM, in_APP_yr, in_IMP_SUB, in_MAX_STUD As New OleDb.OleDbParameter
IN_CRS_code.Direction = ParameterDirection.Input
in_CRS_nm.Direction = ParameterDirection.Input
in_CRS_DESC.Direction = ParameterDirection.Input
in_NO_OF_SEM.Direction = ParameterDirection.Input
in_APP_yr.Direction = ParameterDirection.Input
in_IMP_SUB.Direction = ParameterDirection.Input
in_MAX_STUD.Direction = ParameterDirection.Input

cmd.Parameters.Add("IN_CRS_code", OleDb.OleDbType.LongVarChar).Value = txtCrsCd.Text
cmd.Parameters.Add("in_CRS_nm", OleDb.OleDbType.LongVarChar).Value = txtCrsNm.Text
cmd.Parameters.Add("in_CRS_DESC", OleDb.OleDbType.LongVarChar).Value = txtCrsDesc.Text
cmd.Parameters.Add("in_NO_OF_SEM", OleDb.OleDbType.Integer).Value = Convert.ToInt32(txtNoOfSem.Text)
cmd.Parameters.Add("in_APP_yr", OleDb.OleDbType.Integer).Value = Convert.ToInt32(txtCrsAppYr.Text)
cmd.Parameters.Add("in_IMP_SUB", OleDb.OleDbType.LongVarChar).Value = txtImpSub.Text
cmd.Parameters.Add("in_MAX_STUD", OleDb.OleDbType.Integer).Value = Convert.ToInt32(txtMaxStud.Text)

MsgBox(cmd.CommandText)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
MsgBox("one COURSE added successfully", MsgBoxStyle.Information, "COURSE Details")

on the RESET Button Click

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim c As New Control
' Iterate through a collection
For Each c In Me.Controls
If TypeOf c Is TextBox Then
c.Text = ""
End If
Next
End Sub

No comments:

Post a Comment

Page copy protected against web site content infringement by Copyscape
hit counter
ಇಂದಿಗೆ ಭೇಟಿ ಮಾಡಿದವರು