-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlock.aspx.vb
More file actions
47 lines (41 loc) · 1.8 KB
/
Copy pathBlock.aspx.vb
File metadata and controls
47 lines (41 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Imports System.Data.OleDb
Partial Class Block
Inherits System.Web.UI.Page
Dim con As New OleDbConnection
Dim da As New OleDbDataAdapter
Dim cmd As New OleDbCommand
Dim ds As New Data.DataSet
Dim str As String
Dim r As Integer
Dim currow, totrec As Integer
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim str As String
str = "insert into Block values('" & TextBox2.Text & "','" & TextBox3.Text & "',' " & TextBox1.Text & " ' )"
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
MsgBox("RECORD SAVED SUCCESSFULLY")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim str As String
str = "delete from Block where name='" & TextBox2.Text & "'"
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
MsgBox("name deleted")
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MSBE\Agriculture.mdb")
con.Open()
da = New OleDbDataAdapter("select*from Block", con)
da.Fill(ds, "Block")
totrec = ds.Tables("Block").Rows.Count
currow = 0
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
str = "update Block set name='" & TextBox3.Text & "',id='" & TextBox2.Text & "'where Districtid='" & TextBox1.Text & "'"
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
MsgBox("Record updated")
End Sub
End Class