0% found this document useful (0 votes)
7 views6 pages

Anurag 5

The document contains code snippets for multiple forms in a Windows application using Visual Basic. Form5 allows updating item prices in a database, while Form4 handles user registration. Both forms establish a connection to an Access database and include event handlers for button clicks to execute database operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Anurag 5

The document contains code snippets for multiple forms in a Windows application using Visual Basic. Form5 allows updating item prices in a database, while Form4 handles user registration. Both forms establish a connection to an Access database and include event handlers for button clicks to execute database operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
Dim a As New Form9
a.Show()
Me.Hide()
End Sub
End Class
FORM6
FORM6 CODING
Imports System.Data.OleDb
Public Class Form5
Dim conn As New OleDbConnection
Dim com As New OleDbCommand
Dim da As New OleDbDataAdapter
Dim rd As OleDbDataReader
Dim dps, sql As String
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
dps = "Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=E:\WindowsApplication3\WindowsApplication3\tender1.accdb"
conn.ConnectionString = dps
End Sub

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


Handles Button1.Click
conn.Open()
sql = "update item set gramprice=" & TextBox1.Text & " where type='" & TextBox2.Text
& "'"
da.UpdateCommand = New OleDbCommand(sql, conn)
da.UpdateCommand.ExecuteNonQuery()
MsgBox("updated")
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class
FORM7
FORM7 CODING
Imports System.Data.OleDb
Public Class Form4
Dim con As New OleDbConnection
Dim com As New OleDbCommand
Dim da As New OleDbDataAdapter
Dim rd As OleDbDataReader
Dim dps, sql As String
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
dps = "Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=E:\WindowsApplication3\WindowsApplication3\tender1.accdb"
con.ConnectionString = dps
con.Open()
End Sub

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


Handles Button1.Click
sql = "insert into admin (name,password) values ('" & TextBox2.Text & "','" &
TextBox3.Text & "' )"
da.InsertCommand = New OleDbCommand(sql, con)
MsgBox("Registration Completed successfully")
TextBox3.Text = ""
TextBox2.Text = ""
End Sub
End ClasS
FORM8

You might also like