0% found this document useful (0 votes)
117 views

Acknowledgement

This document contains code for a student database project, including coding for inserting records into a database table, deleting records, searching the table, and displaying the table. Declarations are also included stating the project is the student's individual work. The coding demonstrates how to perform common database operations like inserting, deleting, and searching records in a table.

Uploaded by

Ankur Singh
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)
117 views

Acknowledgement

This document contains code for a student database project, including coding for inserting records into a database table, deleting records, searching the table, and displaying the table. Declarations are also included stating the project is the student's individual work. The coding demonstrates how to perform common database operations like inserting, deleting, and searching records in a table.

Uploaded by

Ankur Singh
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/ 9

Homework Title / No.

: Course Code :CAP407

Course Instructor : Pankaj sir

Student’s Roll No a18 Section No. : D3802

Declaration:
I declare that this assignment is my individual work. I have not copied from any other student’s
work or from any other source except where due acknowledgment is made explicitly in the text,
nor has any part been written for me by another person.

Student’s Signature : Amit kumar

Evaluator’s comments:
_____________________________________________________________________

Marks obtained : ___________ out of ______________________

Acknowledgement
I am thankful to my course tutor miss Ravinder Mam for giving me this
topic for making the term paper. This term paper was a difficult task for
me but with the help of my teacher and the guidance of my parents I
have completed this.

I am also thankful to my parents for provided me the equipments that


are used for search work of the topic.

At last I am also thankful to my friends and my classmates for their


support and help.
Design of the main form

Coding of insert button


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.PriyaTableAdapter.Insert(TextBox1.Text, TextBox2.Text,
TextBox3.Text, DateTimePicker1.Text, DateTimePicker2.Text, TextBox5.Text,
ComboBox1.Text, TextBox7.Text)
Me.PriyaTableAdapter.Fill(Me.DataSet1.priya)
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
'TextBox4.Text = ""
TextBox5.Text = ""
'TextBox6.Text = ""
ComboBox1.Text = ""
TextBox7.Text = ""
End
Coding of delete
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim c As New OdbcConnection("dsn=priya")

c.Open()
Dim s As String = "delete * from priya where name = '" + TextBox1.Text
+ "'"
Dim q As New OdbcCommand(s, c)
q.ExecuteNonQuery()
c.Close()
Me.PriyaTableAdapter.Fill(Me.DataSet1.priya)
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
'TextBox4.Text = ""
TextBox5.Text = ""
'TextBox6.Text = ""
ComboBox1.Text = ""
TextBox7.Text = ""
End Sub

Coding of search
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
Dim c As New OdbcConnection("dsn=priya")
''for running any insert, delete, update command
Dim vCommand As OdbcCommand
Dim dr As OdbcDataReader

'vConn = New OdbcConnection("dsn=Test")

c.Open()

' Dim empid As String

' empid = TextBox1.Text

Dim vQuery As String


vQuery = "Select * from priya where name='" & TextBox1.Text & "'"

vCommand = New OdbcCommand(vQuery, c)


dr = vCommand.ExecuteReader
Me.PriyaTableAdapter.Insert(TextBox1.Text, TextBox2.Text,
TextBox3.Text, DateTimePicker1.Text, DateTimePicker2.Text, TextBox5.Text,
ComboBox1.Text, TextBox7.Text)

If (dr.HasRows) Then
While dr.Read
TextBox1.Text = dr.Item("name")
TextBox2.Text = dr.Item("add")
TextBox3.Text = dr.Item("phone")
DateTimePicker1.Text = dr.Item("cin")
DateTimePicker2.Text = dr.Item("cout")
TextBox5.Text = dr.Item("days")
ComboBox1.Text = dr.Item("type")
TextBox7.Text = dr.Item("no")
End While
End If
c.Close()
End Sub
Coding of show button
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Label9.Visible = True
DataGridView1.Visible = True
'Me.Size.Width.ToString("385")
'Me.Size.Height.ToString("533")
End Sub
Design of table

You might also like