Sunteți pe pagina 1din 12

Public NotInheritable Class SplashScreen1 'TODO: This form can easily be set as the splash screen for the

application by going to the "Application" tab ' of the Project Designer ("Properties" under the "Project" menu).

Private Sub SplashScreen1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Set up the dialog text at runtime according to the application's assembly information. 'TODO: Customize the application's assembly information in the "Application" pane of the project ' properties dialog (under the "Project" menu). 'Application title If My.Application.Info.Title <> "" Then ApplicationTitle.Text = My.Application.Info.Title Else 'If the application title is missing, use the application name, without the extension ApplicationTitle.Text = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName) End If 'Format the version information using the text set into the Version control at design time as the ' formatting string. This allows for effective localization if desired. ' Build and revision information could be included by using the following code and changing the ' Version control's designtime text to "Version {0}.{1:00}.{2}.{3}" or something similar. See ' String.Format() in Help for more information. ' ' Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision) Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor) 'Copyright info Copyright.Text = My.Application.Info.Copyright End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick End Sub Private Sub ApplicationTitle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ApplicationTitle.Click End Sub End Class

Public Class Form1 Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click Me.Close() End Sub Private Sub FormToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FormToolStripMenuItem.Click form2.Show() End Sub Private Sub FeeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FeeToolStripMenuItem.Click Form3.Show() End Sub Private Sub MenupulationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenupulationToolStripMenuItem.Click Form4.Show() End Sub Private Sub NavigationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NavigationToolStripMenuItem.Click Form5.Show() End Sub Private Sub SearchToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SearchToolStripMenuItem.Click

End Sub Private Sub SerchReportToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SerchReportToolStripMenuItem.Click Form7.Show() End Sub Private Sub VToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VToolStripMenuItem.Click Form8.Show() End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Imports System.Data Imports System.Data.SqlClient Public Class Form2 Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged End Sub Dim cmd As SqlCommand Dim con As SqlConnection

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click con = New SqlConnection("Server=(local); database=rishi; user =user; password=user123;") con.Open() cmd = New SqlCommand("insert into p1 ([cusid],[cusname],[age],[date], [addr]) values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & RichTextBox1.Text & "')", con) cmd.ExecuteNonQuery() MessageBox.Show("One Rows iserted succesfully") con.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" RichTextBox1.Text = "" TextBox1.Focus() End Sub Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Imports System.Data

Imports System.Data.SqlClient Public Class Form4 Dim con As SqlConnection Dim cmd As SqlCommand Dim dr As SqlDataReader Dim dr1 As SqlDataReader Dim ra As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click con = New SqlConnection("server=(local);uid=user;pwd=user123;database=rishi") con.Open() cmd = New SqlCommand("insert into test([cusid],[testtype],[refer], [fee]) values (" & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "'," & TextBox4.Text & ")", con) cmd.ExecuteNonQuery() MessageBox.Show("New Row Inserted") con.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click con = New SqlConnection("server=(local);uid=user;pwd=user123;database=rishi") con.Open() cmd = New SqlCommand("Delete from test where cusid= 123", con) cmd.ExecuteNonQuery() MessageBox.Show("one Row deleted") con.Close() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click con = New SqlConnection("server=(local);uid=user;pwd=user123;database=rishi") con.Open() cmd = New SqlCommand("Update test Set cusid=222 where refer='dr daddu'", con) ra = cmd.ExecuteNonQuery() MessageBox.Show("Records affected" & ra) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox1.Focus() End Sub Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub

End Class

Public Class Form5 Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Imports System.Data Imports System.Data.SqlClient Public Class Form6 Dim cmd As SqlCommand Dim con As SqlConnection Dim dr As SqlDataReader Dim p, q As Integer Dim x, y As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click x = TextBox1.Text y = TextBox2.Text con = New SqlConnection("Server=(local); database=rishi; user =user; password=user123;") con.Open() cmd = New SqlCommand("select * from login where cusid='" & TextBox1.Text & "'", con) cmd.ExecuteNonQuery() dr = cmd.ExecuteReader If dr.HasRows Then While dr.Read 'MsgBox("cusid is Available") p = dr.GetValue(0) q = dr.GetValue(1) End While

Else

' MsgBox("cusid not available") End If

If TextBox1.Text = p And TextBox2.Text = q Then Form1.Show() MessageBox.Show("Welcome you are loged in ") TextBox1.Text = "" TextBox2.Text = "" TextBox1.Focus() Else MessageBox.Show("retry") TextBox1.Text = "" TextBox2.Text = "" TextBox1.Focus() End If

con.Close() End Sub Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Imports System.Data Imports System.Data.SqlClient Public Class Form7 Dim myconnection As SqlConnection Dim mycommand As SqlCommand Dim dr As SqlDataReader Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click myconnection = New SqlConnection("server=(local);uid=user;pwd=user123;database=rishi") myconnection.Open() mycommand = New SqlCommand("(select * from test where cusid =" & TextBox1.Text & ")", myconnection) mycommand.ExecuteNonQuery() dr = mycommand.ExecuteReader If dr.HasRows Then While dr.Read MsgBox("id is Available") TextBox1.Text = dr.GetValue(0) TextBox2.Text = dr.GetValue(1) TextBox3.Text = dr.GetValue(2) TextBox4.Text = dr.GetValue(3) End While Else MsgBox("id not available") End If myconnection.Close() ' MessageBox.Show("Records deleted") myconnection.Close() End Sub Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Public Class Form8 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End Sub Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

S-ar putea să vă placă și