Welcome form:
Public Class Form5
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Close()
Form1.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
End Class
Entry form:
Imports System.Data.SqlClient
Imports System.Data
Public Class Form1
Dim con As New SqlClient.SqlConnection
Dim cmd As New SqlCommand
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
'MasterDataSet.ForeignTrade' table. You can move, or remove it, as needed.
Me.ForeignTradeTableAdapter.Fill(Me.MasterDataSet.ForeignTrade)
con.ConnectionString = "Data Source=NISHA-PC\NISHA;Initial
Catalog=master;Integrated Security=True"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
con.Open()
cmd.CommandText = "select * from ForeignTrade where ProductName = '" &
ComboBox1.Text & "' "
cmd.Connection = con
cmd.ExecuteNonQuery()
Dim rdr As SqlDataReader
rdr = cmd.ExecuteReader
If rdr.Read = False Then
MsgBox("Sorry!Product unavailable..Try Again")
Else
Me.Hide()
Form2.Show()
End If
con.Close()
End Sub
End Class
Product Details Form:
Imports System.Data.SqlClient
Imports System.Data
Public Class Form2
Dim con As New SqlClient.SqlConnection
Dim cmd As New SqlCommand
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
con.ConnectionString = "Data Source=NISHA-PC\NISHA;Initial
Catalog=master;Integrated Security=True"
Me.Label7.Text = Form1.ComboBox1.Text
con.Open()
cmd.CommandText = "select * from ForeignTrade where ProductName = '" &
Label7.Text & "'"
cmd.Connection = con
cmd.ExecuteNonQuery()
Dim rdr1 As SqlDataReader
rdr1 = cmd.ExecuteReader
rdr1.Read()
Dim ad = rdr1.Item("Address")
Dim num = rdr1.Item("PhoneNum")
Dim id = rdr1.Item("ProductID")
Label6.Text = id.ToString
Label8.Text = ad.ToString
Label9.Text = num.ToString
con.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Close()
form3.show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
Form1.Show()
End Sub
End Class
Price Info:
Imports System.Data.SqlClient
Imports System.Data
Public Class Form3
Dim con As New SqlClient.SqlConnection
Dim cmd As New SqlCommand
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
con.ConnectionString = "Data Source=NISHA-PC\NISHA;Initial
Catalog=master;Integrated Security=True"
Me.Label3.Text = Form1.ComboBox1.Text
con.Open()
cmd.CommandText = "select * from ForeignTrade where ProductName = '" &
Label3.Text & "'"
cmd.Connection = con
cmd.ExecuteNonQuery()
Dim rdr1 As SqlDataReader
rdr1 = cmd.ExecuteReader
rdr1.Read()
Dim pr = rdr1.Item("Price")
Label5.Text = pr.ToString
con.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
Form1.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Close()
Form4.Show()
End Sub
End Class
Purchase Form:
Imports System.Data.SqlClient
Imports System.Data
Public Class Form4
Dim con As New SqlClient.SqlConnection
Dim cmd As New SqlCommand
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
con.ConnectionString = "Data Source=NISHA-PC\NISHA;Initial
Catalog=master;Integrated Security=True"
Me.Label2.Text = Form1.ComboBox1.Text
Label5.Hide()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.Close()
Form1.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MsgBox("Purchased '" & Label2.Text & "' Successfully!! Thank You")
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
con.Open()
cmd.CommandText = "select * from ForeignTrade where ProductName = '" &
Label2.Text & "'"
cmd.Connection = con
cmd.ExecuteNonQuery()
Dim rdr1 As SqlDataReader
rdr1 = cmd.ExecuteReader
rdr1.Read()
Dim pr = rdr1.Item("Price")
Dim qu = Convert.ToInt16(TextBox1.Text)
Dim tprice = pr * qu
Label5.Text = tprice.ToString
Label5.Show()
con.Close()
End Sub
End Class