You are on page 1of 6

Title Page

Home Work Title/no:-01 Course Code:- CAP304

Course Instructor:- Mr. Pankaj Course Tutor:-Mr. Pankaj

Date of Allotment:- Date of Submission:-11/05/10

Student Roll no:-A22 Section no:-D3802

Declaration:-

“I declare that this Term Ppaer is my individual work .I have not copied from any other
students work or from any other students source except where due acknowledgement is
made explicitly in the text. Not as any part being written for me by another person”.

Rashim

Evaluator Comment:-_____________________________________________

Marks_________________________ Out of:-_________________________


Acknowledgement

“Gratitude is not a thing of expression; it is more a matter of feeling”

With profound sense of gratitude, I acknowledge my indebtness to her almighty for


his grace, which made my project success.
I express my deepest sense of gratitude and sincere thanks to my Project Head
Mr.pankaj for her inspiration, keen interest, unceasing assistance and helpful
evaluation at all stages of work. The present shape of the work is due to her able
guidance, constant supervision, healthy constructive criticism and above all her
most sympathetic and kind attitude through the period of project work.
I am highly thankful to my Faculty Guide for their guidance, valuable suggestions
and encouragement for completion of my term paper and for providing all
necessary facilities from the institute, without which it would be highly difficult to
give this shape to thesis work.
Last but not least, I express my sincere feeling of gratitude to all my friends and
my parents who have constantly encourage and helped me in carrying out this
work.
I have received from many and return this work to those who feel an interest or
need.
Rashim
Imports System.Data.Odbc

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'DataSet1.yamini' table.
You can move, or remove it, as needed.
Me.YaminiTableAdapter.Fill(Me.DataSet1.yamini)
ComboBox1.Items.Add("Indira Gandhi Airport")
ComboBox1.Items.Add("Amritsar Airport")
ComboBox2.Items.Add("Jet Airways")
ComboBox2.Items.Add("Sahara Airlines")
End Sub

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


System.EventArgs) Handles Button1.Click
TextBox1.Text.ToUpper()

Dim con As New OdbcConnection("dsn=yamini")

Dim s As String = "insert into yamini values('" + TextBox1.Text +


"','" + TextBox2.Text + "','" + ComboBox1.Text + "', '" + ComboBox2.Text +
"', '" + TextBox4.Text + "', '" + DateTimePicker1.Text + "', '" +
DateTimePicker2.Text + "','" + TextBox8.Text + "','" + ComboBox2.Text + "', '"
+ TextBox4.Text + "','" + DateTimePicker3.Text + "', '" +
DateTimePicker4.Text + "','" + TextBox3.Text + "','" + TextBox5.Text + "')"
con.Open()
Dim c As New OdbcCommand(s, con)
c.ExecuteNonQuery()
con.Close()

'Me.YaminiTableAdapter.Insert(TextBox1.Text, TextBox2.Text,
ComboBox1.Text, ComboBox2.Text, TextBox4.Text, DateTimePicker1.Text,
DateTimePicker2.Text, TextBox8.Text, ComboBox2.Text, TextBox4.Text,
DateTimePicker3.Text, DateTimePicker4.Text, TextBox3.Text, TextBox5.Text)
'Me.YaminiTableAdapter.Fill(Me.DataSet1.yamini)
TextBox1.Text = ""
TextBox2.Text = ""
TextBox4.Text = ""
TextBox8.Text = ""
TextBox3.Text = ""
TextBox5.Text = ""
MessageBox.Show("Records Inserted")

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
Dim con As New OdbcConnection("dsn=yamini")

Dim s As String = "delete * from yamini where name= '" +


TextBox1.Text + "'"
con.Open()
Dim c As New OdbcCommand(s, con)
c.ExecuteNonQuery()
con.Close()
Me.YaminiTableAdapter.Fill(Me.DataSet1.yamini)
TextBox1.Text = ""
MessageBox.Show("Record Deleted")
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
Dim c As New OdbcConnection("dsn=yamini")
''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 yamini where name='" & TextBox1.Text & "'"
vCommand = New OdbcCommand(vQuery, c)
dr = vCommand.ExecuteReader

If (dr.HasRows) Then
While dr.Read

TextBox2.Text = dr.Item("add")
TextBox4.Text = dr.Item("flight")
ComboBox1.Text = dr.Item("airpo")
ComboBox2.Text = dr.Item("airli")
DateTimePicker1.Text = dr.Item("ad")
DateTimePicker2.Text = dr.Item("at")
TextBox8.Text = dr.Item("dairport")
TextBox10.Text = dr.Item("dairline")
DateTimePicker3.Text = dr.Item("dd")
DateTimePicker4.Text = dr.Item("dt")
TextBox3.Text = dr.Item("from")
TextBox5.Text = dr.Item("to")

End While
End If
c.Close()
End Sub

Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
TextBox10.Text = ComboBox2.Text
End Sub

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox4.TextChanged
TextBox9.Text = TextBox4.Text

End Sub

Private Sub TextBox4_KeyPress(ByVal sender As System.Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If Not Char.IsDigit(e.KeyChar) Then
e.Handled = True
End If
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
Form2.ShowDialog()

End Sub
End Class
Public Class Form2

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'DataSet2.yamini' table.
You can move, or remove it, as needed.
Me.YaminiTableAdapter.Fill(Me.DataSet2.yamini)

End Sub

End Class