asp.net election project with crystal report and gridview update / add when id is autonumber data type in access database
Sub Page_Load If Not Page.IsPostBack Then
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from POLLING", conn)
Dim dset As New Data.DataSet
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from OFFICER", conn)Dim dset1 As New Data.DataSet
Dim conn2 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp2 As New OleDbDataAdapter("select * from STAFF", conn)Dim dset2 As New Data.DataSet
adp.Fill(dset, "POLLING")
adp1.Fill(dset1, "OFFICER")adp2.Fill(dset2, "STAFF")
D1.DataSource = dset
D1.DataTextField = "GPU"D1.DataValueField = "GPU"
D1.DataBind()
E1.DataSource = dset1
E1.DataTextField = "NAME"E1.DataValueField = "NAME"
E1.DataBind()
F1.DataSource = dset2
F1.DataTextField = "NAME"F1.DataValueField = "NAME"
F1.DataBind()
F2.DataSource = dset2
F2.DataTextField = "NAME"F2.DataValueField = "NAME"
F2.DataBind()
F3.DataSource = dset2
F3.DataTextField = "NAME"F3.DataValueField = "NAME"
F3.DataBind()
F4.DataSource = dset2
F4.DataTextField = "NAME"F4.DataValueField = "NAME"
F4.DataBind()
END IF
End Sub
Sub HOME(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("http://10.182.186.100/ED/Home.aspx")End Sub
Sub PREENTRY(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("PREENTRY.aspx")
End Sub
sub EDIT(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("EDIT.aspx")End Sub
Sub REPORT(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("REPORT.aspx")End Sub
Sub REPORT1(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("REPORT1.aspx")
End Sub
Sub EDIT1(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("EDIT1.aspx")
End Sub
Sub D1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING where GPU='" & D1.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D2.DataSource = dset
D2.DataTextField = "WARD"
D2.DataValueField = "WARD"
D2.DataBind()
End Sub
Sub D2F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING where WARD='" & D2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D3.DataSource = dset
D3.DataTextField = "POLLINGNO"
D3.DataValueField = "POLLINGNO"
D3.DataBind()
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D3F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from POLLING where POLLINGNO='" & D3.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D4F(sender As Object, e As System.EventArgs)
End Sub
Sub E1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from OFFICER where NAME='" & E1.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "OFFICER")
E2.DataSource = dset
E3.DataSource = dset
E2.DataTextField = "DESIGNATION"
E2.DataValueField = "DESIGNATION"
E3.DataTextField = "DEPARTMENT"
E3.DataValueField = "DEPARTMENT"
E2.DataBind()
E3.DataBind()
End Sub
Sub F1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F1.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F1A.DataSource = dset
F1A.DataTextField = "DESIGNATION"
F1A.DataValueField = "DESIGNATION"
F1A.DataBind()
End Sub
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F2A.DataSource = dset
F2A.DataTextField = "DESIGNATION"
F2A.DataValueField = "DESIGNATION"
F2A.DataBind()
End Sub
Sub F3F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F3.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F3A.DataSource = dset
F3A.DataTextField = "DESIGNATION"
F3A.DataValueField = "DESIGNATION"
F3A.DataBind()
End Sub
Sub F4F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F4.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F4A.DataSource = dset
F4A.DataTextField = "DESIGNATION"
F4A.DataValueField = "DESIGNATION"
F4A.DataBind()
End Sub
________________________
asp:DropDownList id="D4" runat="server" __designer:wfdid="w2" Width="150px" OnSelectedIndexChanged="D4F" AutoPostBack="true">
asp:Button ID="Button1" runat="server" Font-Bold="True" ForeColor="GREEN" Text="<< HOME"
Width="128px" onclick="HOME"
Dim adp As New OleDbDataAdapter("select * from POLLING", conn)
Dim dset As New Data.DataSet
Dim dset1 As New Data.DataSet
Dim dset2 As New Data.DataSet
adp2.Fill(dset2, "STAFF")
D1.DataValueField = "GPU"
D1.DataBind()
E1.DataValueField = "NAME"
E1.DataBind()
F1.DataValueField = "NAME"
F1.DataBind()
F2.DataValueField = "NAME"
F2.DataBind()
F3.DataValueField = "NAME"
F3.DataBind()
F4.DataValueField = "NAME"
F4.DataBind()
END IF
End Sub
Sub MORE(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("EDIT3.aspx")
End Sub
Dim str As String
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim dset As New Data.DataSet
str = "update POLLING set OFFICER='" & E1.Text & ", " & E2.TEXT & ", " & E3.TEXT & ", " & E4.TEXT & ", " & E5.TEXT & "', PRE1='" & F1.Text & ", " & F11.TEXT & ", " & F111.TEXT & ", " & F1111.TEXT & ", " & F11111.TEXT & "', PRE2='" & F2.Text & ", " & F22.TEXT & ", " & F222.TEXT & ", " & F2222.TEXT & ", " & F22222.TEXT & "', PRE3='" & F3.Text & ", " & F33.TEXT & ", " & F333.TEXT & ", " & F3333.TEXT & ", " & F33333.TEXT & "', PRE4='" & F4.Text & ", " & F44.TEXT & ", " & F444.TEXT & ", " & F4444.TEXT & ", " & F44444.TEXT & "' where GPU='" & D1.Text & "' AND WARD='" & D2.TEXT & "'"
If textbox1.text="road" then
Dim adp As New OleDbDataAdapter(str, conn)
adp.Fill(dset, "POLLING")
textbox1.text="RECORD SAVED"
Response.Redirect("EDIT.aspx")
conn.Close()
else
textbox1.text="wrong password"
End If
End Sub
Dim adp As New OleDbDataAdapter("select * from POLLING where GPU='" & D1.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D2.DataSource = dset
D2.DataTextField = "WARD"
D2.DataValueField = "WARD"
D2.DataBind()
End Sub
Dim adp As New OleDbDataAdapter("select * from POLLING where WARD='" & D2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D3.DataSource = dset
D3.DataTextField = "POLLINGNO"
D3.DataValueField = "POLLINGNO"
D3.DataBind()
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D4F(sender As Object, e As System.EventArgs)
Dim dset As New Data.DataSet
adp.Fill(dset, "OFFICER")
E2.DataSource = dset
E3.DataSource = dset
E4.DataSource = dset
E5.DataSource = dset
E2.DataTextField = "DESIGNATION"
E2.DataValueField = "DESIGNATION"
E3.DataTextField = "DEPARTMENT"
E3.DataValueField = "DEPARTMENT"
E4.DataTextField = "POSTING"
E4.DataValueField = "POSTING"
E5.DataTextField = "CNO"
E5.DataValueField = "CNO"
E2.DataBind()
E3.DataBind()
E4.DataBind()
E5.DataBind()
End Sub
Sub F1F(sender As Object, e As System.EventArgs)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F11.DataSource = dset
F11.DataTextField = "DESIGNATION"
F11.DataValueField = "DESIGNATION"
F11.DataBind()
F111.DataSource = dset
F111.DataTextField = "DEPARTMENT"
F111.DataValueField = "DEPARTMENT"
F111.DataBind()
F1111.DataSource = dset
F1111.DataTextField = "POSTING"
F1111.DataValueField = "POSTING"
F1111.DataBind()
F11111.DataSource = dset
F11111.DataTextField = "CNO"
F11111.DataValueField = "CNO"
F11111.DataBind()
End Sub
Sub F2F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F22.DataSource = dset
F22.DataTextField = "DESIGNATION"
F22.DataValueField = "DESIGNATION"
F22.DataBind()
F222.DataSource = dset
F222.DataTextField = "DEPARTMENT"
F222.DataValueField = "DEPARTMENT"
F222.DataBind()
F2222.DataSource = dset
F2222.DataTextField = "POSTING"
F2222.DataValueField = "POSTING"
F2222.DataBind()
F22222.DataSource = dset
F22222.DataTextField = "CNO"
F22222.DataValueField = "CNO"
F22222.DataBind()
End Sub
Sub F3F(sender As Object, e As System.EventArgs)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F33.DataSource = dset
F33.DataTextField = "DESIGNATION"
F33.DataValueField = "DESIGNATION"
F33.DataBind()
F333.DataSource = dset
F333.DataTextField = "DEPARTMENT"
F333.DataValueField = "DEPARTMENT"
F333.DataBind()
F3333.DataSource = dset
F3333.DataTextField = "POSTING"
F3333.DataValueField = "POSTING"
F3333.DataBind()
F33333.DataSource = dset
F33333.DataTextField = "CNO"
F33333.DataValueField = "CNO"
F33333.DataBind()
End Sub
Sub F4F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F4.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F44.DataSource = dset
F44.DataTextField = "DESIGNATION"
F44.DataValueField = "DESIGNATION"
F44.DataBind()
F444.DataSource = dset
F444.DataTextField = "DEPARTMENT"
F444.DataValueField = "DEPARTMENT"
F444.DataBind()
F4444.DataSource = dset
F4444.DataTextField = "POSTING"
F4444.DataValueField = "POSTING"
F4444.DataBind()
F44444.DataSource = dset
F44444.DataTextField = "CNO"
F44444.DataValueField = "CNO"
F44444.DataBind()
End Sub
Dim adp As New OleDbDataAdapter("select * from POLLING", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
TextBox6.Text = dset.Tables(0).Rows(0).Item(3)
TextBox1.Text = dset.Tables(0).Rows(0).Item(5)
TextBox2.Text = dset.Tables(0).Rows(0).Item(6)
TextBox3.Text = dset.Tables(0).Rows(0).Item(7)
TextBox4.Text = dset.Tables(0).Rows(0).Item(8)
TextBox5.Text = dset.Tables(0).Rows(0).Item(9)
END IF
End Sub
Sub SEARCH(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from POLLING where ID=" & TextBox6.Text, conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
TextBox6.Text = dset.Tables(0).Rows(0).Item(3)
TextBox1.Text = dset.Tables(0).Rows(0).Item(5)
TextBox2.Text = dset.Tables(0).Rows(0).Item(6)
TextBox3.Text = dset.Tables(0).Rows(0).Item(7)
TextBox4.Text = dset.Tables(0).Rows(0).Item(8)
TextBox5.Text = dset.Tables(0).Rows(0).Item(9)
End Sub
Sub UPDATE(ByVal sender As Object, ByVal e As EventArgs)
Dim str As String
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim dset As New Data.DataSet
str="update POLLING set OFFICER='" & TextBox1.Text & "', PRE1='" & TextBox2.Text & "', PRE2='" & TextBox3.Text & "', PRE3='" & TextBox4.Text & "', PRE4='" & TextBox5.Text & "' where ID = " & TextBox6.Text
If textbox10.text="road" then
Dim adp As New OleDbDataAdapter(str, conn)
adp.Fill(dset, "POLLING")
Response.Redirect("EDIT1.aspx")
conn.Close()
else
textbox10.text="wrong password"
End If
End Sub
Dim adp As New OleDbDataAdapter("select * from POLLING", conn)
Dim dset As New Data.DataSet
Dim dset1 As New Data.DataSet
Dim dset2 As New Data.DataSet
adp2.Fill(dset2, "STAFF")
D1.DataValueField = "GPU"
D1.DataBind()
E1.DataValueField = "NAME"
E1.DataBind()
F1.DataValueField = "NAME"
F1.DataBind()
F2.DataValueField = "NAME"
F2.DataBind()
F3.DataValueField = "NAME"
F3.DataBind()
F4.DataValueField = "NAME"
F4.DataBind()
END IF
End Sub
Sub MORE(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("EDIT.aspx")
End Sub
Sub OFFS(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from OFFICER where NAME like '" & textbox2.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "OFFICER")
E1.DataSource = dset1
E1.DataTextField = "NAME"
E1.DataValueField = "NAME"
E1.DataBind()
E2.DataTextField = "DESIGNATION"
E2.DataValueField = "DESIGNATION"
E2.DataBind()
E3.DataTextField = "DEPARTMENT"
E3.DataValueField = "DEPARTMENT"
E3.DataBind()
E4.DataTextField = "POSTING"
E4.DataValueField = "POSTING"
E4.DataBind()
E5.DataTextField = "CNO"
E5.DataValueField = "CNO"
E5.DataBind()
End Sub
Sub S1S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox3.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F1.DataSource = dset1
F1.DataTextField = "DESIGNATION"
F1.DataValueField = "DESIGNATION"
F1.DataBind()
F11.DataSource = dset1
F11.DataTextField = "DESIGNATION"
F11.DataValueField = "DESIGNATION"
F11.DataBind()
F111.DataSource = dset1
F111.DataTextField = "DEPARTMENT"
F111.DataValueField = "DEPARTMENT"
F111.DataBind()
F1111.DataSource = dset1
F1111.DataTextField = "POSTING"
F1111.DataValueField = "POSTING"
F1111.DataBind()
F11111.DataSource = dset1
F11111.DataTextField = "CNO"
F11111.DataValueField = "CNO"
F11111.DataBind()
End Sub
Sub S2S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox4.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F2.DataSource = dset1
F2.DataTextField = "DESIGNATION"
F2.DataValueField = "DESIGNATION"
F2.DataBind()
F22.DataSource = dset1
F22.DataTextField = "DESIGNATION"
F22.DataValueField = "DESIGNATION"
F22.DataBind()
F222.DataSource = dset1
F222.DataTextField = "DEPARTMENT"
F222.DataValueField = "DEPARTMENT"
F222.DataBind()
F2222.DataSource = dset1
F2222.DataTextField = "POSTING"
F2222.DataValueField = "POSTING"
F2222.DataBind()
F22222.DataSource = dset1
F22222.DataTextField = "CNO"
F22222.DataValueField = "CNO"
F22222.DataBind()
End Sub
Sub S3S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox5.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F3.DataSource = dset1
F3.DataTextField = "DESIGNATION"
F3.DataValueField = "DESIGNATION"
F3.DataBind()
F33.DataSource = dset1
F33.DataTextField = "DESIGNATION"
F33.DataValueField = "DESIGNATION"
F33.DataBind()
F333.DataSource = dset1
F333.DataTextField = "DEPARTMENT"
F333.DataValueField = "DEPARTMENT"
F333.DataBind()
F3333.DataSource = dset1
F3333.DataTextField = "POSTING"
F3333.DataValueField = "POSTING"
F3333.DataBind()
F33333.DataSource = dset1
F33333.DataTextField = "CNO"
F33333.DataValueField = "CNO"
F33333.DataBind()
End Sub
Sub S4S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox6.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F4.DataSource = dset1
F4.DataTextField = "DESIGNATION"
F4.DataValueField = "DESIGNATION"
F4.DataBind()
F44.DataSource = dset1
F44.DataTextField = "DESIGNATION"
F44.DataValueField = "DESIGNATION"
F44.DataBind()
F444.DataSource = dset1
F444.DataTextField = "DEPARTMENT"
F444.DataValueField = "DEPARTMENT"
F444.DataBind()
F4444.DataSource = dset1
F4444.DataTextField = "POSTING"
F4444.DataValueField = "POSTING"
F4444.DataBind()
F44444.DataSource = dset1
F44444.DataTextField = "CNO"
F44444.DataValueField = "CNO"
F44444.DataBind()
End Sub
sub EDIT1(ByVal sender As Object, ByVal e As EventArgs)
Dim str As String
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim dset As New Data.DataSet
str = "update POLLING set OFFICER='" & E1.Text & ", " & E2.TEXT & ", " & E3.TEXT & ", " & E4.TEXT & ", " & E5.TEXT & "', PRE1='" & F1.Text & ", " & F11.TEXT & ", " & F111.TEXT & ", " & F1111.TEXT & ", " & F11111.TEXT & "', PRE2='" & F2.Text & ", " & F22.TEXT & ", " & F222.TEXT & ", " & F2222.TEXT & ", " & F22222.TEXT & "', PRE3='" & F3.Text & ", " & F33.TEXT & ", " & F333.TEXT & ", " & F3333.TEXT & ", " & F33333.TEXT & "', PRE4='" & F4.Text & ", " & F44.TEXT & ", " & F444.TEXT & ", " & F4444.TEXT & ", " & F44444.TEXT & "' where GPU='" & D1.Text & "' AND WARD='" & D2.TEXT & "'"
If textbox1.text="road" then
Dim adp As New OleDbDataAdapter(str, conn)
adp.Fill(dset, "POLLING")
textbox1.text="RECORD SAVED"
Response.Redirect("EDIT.aspx")
conn.Close()
else
textbox1.text="wrong password"
End If
End Sub
Dim adp As New OleDbDataAdapter("select * from POLLING where GPU='" & D1.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D2.DataSource = dset
D2.DataTextField = "WARD"
D2.DataValueField = "WARD"
D2.DataBind()
End Sub
Dim adp As New OleDbDataAdapter("select * from POLLING where WARD='" & D2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D3.DataSource = dset
D3.DataTextField = "POLLINGNO"
D3.DataValueField = "POLLINGNO"
D3.DataBind()
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D4F(sender As Object, e As System.EventArgs)
Dim dset As New Data.DataSet
adp.Fill(dset, "OFFICER")
E2.DataSource = dset
E3.DataSource = dset
E4.DataSource = dset
E5.DataSource = dset
E2.DataTextField = "DESIGNATION"
E2.DataValueField = "DESIGNATION"
E3.DataTextField = "DEPARTMENT"
E3.DataValueField = "DEPARTMENT"
E4.DataTextField = "POSTING"
E4.DataValueField = "POSTING"
E5.DataTextField = "CNO"
E5.DataValueField = "CNO"
E2.DataBind()
E3.DataBind()
E4.DataBind()
E5.DataBind()
End Sub
Sub F1F(sender As Object, e As System.EventArgs)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F11.DataSource = dset
F11.DataTextField = "DESIGNATION"
F11.DataValueField = "DESIGNATION"
F11.DataBind()
F111.DataSource = dset
F111.DataTextField = "DEPARTMENT"
F111.DataValueField = "DEPARTMENT"
F111.DataBind()
F1111.DataSource = dset
F1111.DataTextField = "POSTING"
F1111.DataValueField = "POSTING"
F1111.DataBind()
F11111.DataSource = dset
F11111.DataTextField = "CNO"
F11111.DataValueField = "CNO"
F11111.DataBind()
End Sub
Sub F2F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F22.DataSource = dset
F22.DataTextField = "DESIGNATION"
F22.DataValueField = "DESIGNATION"
F22.DataBind()
F222.DataSource = dset
F222.DataTextField = "DEPARTMENT"
F222.DataValueField = "DEPARTMENT"
F222.DataBind()
F2222.DataSource = dset
F2222.DataTextField = "POSTING"
F2222.DataValueField = "POSTING"
F2222.DataBind()
F22222.DataSource = dset
F22222.DataTextField = "CNO"
F22222.DataValueField = "CNO"
F22222.DataBind()
End Sub
Sub F3F(sender As Object, e As System.EventArgs)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F33.DataSource = dset
F33.DataTextField = "DESIGNATION"
F33.DataValueField = "DESIGNATION"
F33.DataBind()
F333.DataSource = dset
F333.DataTextField = "DEPARTMENT"
F333.DataValueField = "DEPARTMENT"
F333.DataBind()
F3333.DataSource = dset
F3333.DataTextField = "POSTING"
F3333.DataValueField = "POSTING"
F3333.DataBind()
F33333.DataSource = dset
F33333.DataTextField = "CNO"
F33333.DataValueField = "CNO"
F33333.DataBind()
End Sub
Sub F4F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F4.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F44.DataSource = dset
F44.DataTextField = "DESIGNATION"
F44.DataValueField = "DESIGNATION"
F44.DataBind()
F444.DataSource = dset
F444.DataTextField = "DEPARTMENT"
F444.DataValueField = "DEPARTMENT"
F444.DataBind()
F4444.DataSource = dset
F4444.DataTextField = "POSTING"
F4444.DataValueField = "POSTING"
F4444.DataBind()
F44444.DataSource = dset
F44444.DataTextField = "CNO"
F44444.DataValueField = "CNO"
F44444.DataBind()
End Sub
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyNames="ID" DataSourceID="AccessDataSource3" AutoGenerateEditButton="false" Width="672px">
Columns--
--asp:BoundField DataField="GPU" HeaderText="GPU" SortExpression="GPU" --
--asp:BoundField DataField="POLLINGNO" HeaderText="POLLINGNO" SortExpression="POLLINGNO" --
--asp:BoundField DataField="WARD" HeaderText="WARD" SortExpression="WARD" --
--asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" />
--asp:BoundField DataField="LOCATION" HeaderText="LOCATION" SortExpression="LOCATION" --
--Columns>
--RowStyle BackColor="#FFF7E7" ForeColor="#8C4510"---
--SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White"--
--PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
--HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White"--
--asp:GridView--
--asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="e:\ALOKRAJ\ELECTION.mdb"
SelectCommand="SELECT * FROM [POLLING]"--asp:AccessDataSource
Width="128px" onclick="HOME"
If Not Page.IsPostBack Then
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING", conn)
Dim dset As New Data.DataSet
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from OFFICER", conn)Dim dset1 As New Data.DataSet
Dim conn2 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp2 As New OleDbDataAdapter("select * from STAFF", conn)Dim dset2 As New Data.DataSet
adp.Fill(dset, "POLLING")
adp1.Fill(dset1, "OFFICER")adp2.Fill(dset2, "STAFF")
D1.DataSource = dset
D1.DataTextField = "GPU"D1.DataValueField = "GPU"
D1.DataBind()
E1.DataSource = dset1
E1.DataTextField = "NAME"E1.DataValueField = "NAME"
E1.DataBind()
F1.DataSource = dset2
F1.DataTextField = "NAME"F1.DataValueField = "NAME"
F1.DataBind()
F2.DataSource = dset2
F2.DataTextField = "NAME"F2.DataValueField = "NAME"
F2.DataBind()
F3.DataSource = dset2
F3.DataTextField = "NAME"F3.DataValueField = "NAME"
F3.DataBind()
F4.DataSource = dset2
F4.DataTextField = "NAME"F4.DataValueField = "NAME"
F4.DataBind()
END IF
End Sub
Sub HOME1(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("Home.aspx")End Sub
Sub MORE(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("EDIT3.aspx")
End Sub
sub EDIT1(ByVal sender As Object, ByVal e As EventArgs)
Dim str As String
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim dset As New Data.DataSet
str = "update POLLING set OFFICER='" & E1.Text & ", " & E2.TEXT & ", " & E3.TEXT & ", " & E4.TEXT & ", " & E5.TEXT & "', PRE1='" & F1.Text & ", " & F11.TEXT & ", " & F111.TEXT & ", " & F1111.TEXT & ", " & F11111.TEXT & "', PRE2='" & F2.Text & ", " & F22.TEXT & ", " & F222.TEXT & ", " & F2222.TEXT & ", " & F22222.TEXT & "', PRE3='" & F3.Text & ", " & F33.TEXT & ", " & F333.TEXT & ", " & F3333.TEXT & ", " & F33333.TEXT & "', PRE4='" & F4.Text & ", " & F44.TEXT & ", " & F444.TEXT & ", " & F4444.TEXT & ", " & F44444.TEXT & "' where GPU='" & D1.Text & "' AND WARD='" & D2.TEXT & "'"
If textbox1.text="road" then
Dim adp As New OleDbDataAdapter(str, conn)
adp.Fill(dset, "POLLING")
textbox1.text="RECORD SAVED"
Response.Redirect("EDIT.aspx")
conn.Close()
else
textbox1.text="wrong password"
End If
End Sub
Sub REPORT1(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("REPORT.aspx")End Sub
Sub D1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING where GPU='" & D1.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D2.DataSource = dset
D2.DataTextField = "WARD"
D2.DataValueField = "WARD"
D2.DataBind()
End Sub
Sub D2F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING where WARD='" & D2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D3.DataSource = dset
D3.DataTextField = "POLLINGNO"
D3.DataValueField = "POLLINGNO"
D3.DataBind()
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D3F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from POLLING where POLLINGNO='" & D3.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D4F(sender As Object, e As System.EventArgs)
End Sub
Sub E1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from OFFICER where NAME='" & E1.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "OFFICER")
E2.DataSource = dset
E3.DataSource = dset
E4.DataSource = dset
E5.DataSource = dset
E2.DataTextField = "DESIGNATION"
E2.DataValueField = "DESIGNATION"
E3.DataTextField = "DEPARTMENT"
E3.DataValueField = "DEPARTMENT"
E4.DataTextField = "POSTING"
E4.DataValueField = "POSTING"
E5.DataTextField = "CNO"
E5.DataValueField = "CNO"
E2.DataBind()
E3.DataBind()
E4.DataBind()
E5.DataBind()
End Sub
Sub F1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F1.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F11.DataSource = dset
F11.DataTextField = "DESIGNATION"
F11.DataValueField = "DESIGNATION"
F11.DataBind()
F111.DataSource = dset
F111.DataTextField = "DEPARTMENT"
F111.DataValueField = "DEPARTMENT"
F111.DataBind()
F1111.DataSource = dset
F1111.DataTextField = "POSTING"
F1111.DataValueField = "POSTING"
F1111.DataBind()
F11111.DataSource = dset
F11111.DataTextField = "CNO"
F11111.DataValueField = "CNO"
F11111.DataBind()
End Sub
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F22.DataSource = dset
F22.DataTextField = "DESIGNATION"
F22.DataValueField = "DESIGNATION"
F22.DataBind()
F222.DataSource = dset
F222.DataTextField = "DEPARTMENT"
F222.DataValueField = "DEPARTMENT"
F222.DataBind()
F2222.DataSource = dset
F2222.DataTextField = "POSTING"
F2222.DataValueField = "POSTING"
F2222.DataBind()
F22222.DataSource = dset
F22222.DataTextField = "CNO"
F22222.DataValueField = "CNO"
F22222.DataBind()
End Sub
Sub F3F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F3.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F33.DataSource = dset
F33.DataTextField = "DESIGNATION"
F33.DataValueField = "DESIGNATION"
F33.DataBind()
F333.DataSource = dset
F333.DataTextField = "DEPARTMENT"
F333.DataValueField = "DEPARTMENT"
F333.DataBind()
F3333.DataSource = dset
F3333.DataTextField = "POSTING"
F3333.DataValueField = "POSTING"
F3333.DataBind()
F33333.DataSource = dset
F33333.DataTextField = "CNO"
F33333.DataValueField = "CNO"
F33333.DataBind()
End Sub
Sub F4F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F4.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F44.DataSource = dset
F44.DataTextField = "DESIGNATION"
F44.DataValueField = "DESIGNATION"
F44.DataBind()
F444.DataSource = dset
F444.DataTextField = "DEPARTMENT"
F444.DataValueField = "DEPARTMENT"
F444.DataBind()
F4444.DataSource = dset
F4444.DataTextField = "POSTING"
F4444.DataValueField = "POSTING"
F4444.DataBind()
F44444.DataSource = dset
F44444.DataTextField = "CNO"
F44444.DataValueField = "CNO"
F44444.DataBind()
End Sub
________________________
If Not Page.IsPostBack Then
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
TextBox6.Text = dset.Tables(0).Rows(0).Item(3)
TextBox1.Text = dset.Tables(0).Rows(0).Item(5)
TextBox2.Text = dset.Tables(0).Rows(0).Item(6)
TextBox3.Text = dset.Tables(0).Rows(0).Item(7)
TextBox4.Text = dset.Tables(0).Rows(0).Item(8)
TextBox5.Text = dset.Tables(0).Rows(0).Item(9)
END IF
End Sub
Sub HOME(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("Home.aspx")End Sub
Sub SEARCH(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from POLLING where ID=" & TextBox6.Text, conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
TextBox6.Text = dset.Tables(0).Rows(0).Item(3)
TextBox1.Text = dset.Tables(0).Rows(0).Item(5)
TextBox2.Text = dset.Tables(0).Rows(0).Item(6)
TextBox3.Text = dset.Tables(0).Rows(0).Item(7)
TextBox4.Text = dset.Tables(0).Rows(0).Item(8)
TextBox5.Text = dset.Tables(0).Rows(0).Item(9)
End Sub
Sub UPDATE(ByVal sender As Object, ByVal e As EventArgs)
Dim str As String
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim dset As New Data.DataSet
str="update POLLING set OFFICER='" & TextBox1.Text & "', PRE1='" & TextBox2.Text & "', PRE2='" & TextBox3.Text & "', PRE3='" & TextBox4.Text & "', PRE4='" & TextBox5.Text & "' where ID = " & TextBox6.Text
If textbox10.text="road" then
Dim adp As New OleDbDataAdapter(str, conn)
adp.Fill(dset, "POLLING")
Response.Redirect("EDIT1.aspx")
conn.Close()
else
textbox10.text="wrong password"
End If
End Sub
If Not Page.IsPostBack Then
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING", conn)
Dim dset As New Data.DataSet
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from OFFICER", conn)Dim dset1 As New Data.DataSet
Dim conn2 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp2 As New OleDbDataAdapter("select * from STAFF", conn)Dim dset2 As New Data.DataSet
adp.Fill(dset, "POLLING")
adp1.Fill(dset1, "OFFICER")adp2.Fill(dset2, "STAFF")
D1.DataSource = dset
D1.DataTextField = "GPU"D1.DataValueField = "GPU"
D1.DataBind()
E1.DataSource = dset1
E1.DataTextField = "NAME"E1.DataValueField = "NAME"
E1.DataBind()
F1.DataSource = dset2
F1.DataTextField = "NAME"F1.DataValueField = "NAME"
F1.DataBind()
F2.DataSource = dset2
F2.DataTextField = "NAME"F2.DataValueField = "NAME"
F2.DataBind()
F3.DataSource = dset2
F3.DataTextField = "NAME"F3.DataValueField = "NAME"
F3.DataBind()
F4.DataSource = dset2
F4.DataTextField = "NAME"F4.DataValueField = "NAME"
F4.DataBind()
END IF
End Sub
Sub HOME1(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("Home.aspx")End Sub
Sub MORE(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("EDIT.aspx")
End Sub
Sub OFFS(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from OFFICER where NAME like '" & textbox2.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "OFFICER")
E1.DataSource = dset1
E1.DataTextField = "NAME"
E1.DataValueField = "NAME"
E1.DataBind()
E2.DataTextField = "DESIGNATION"
E2.DataValueField = "DESIGNATION"
E2.DataBind()
E3.DataTextField = "DEPARTMENT"
E3.DataValueField = "DEPARTMENT"
E3.DataBind()
E4.DataTextField = "POSTING"
E4.DataValueField = "POSTING"
E4.DataBind()
E5.DataTextField = "CNO"
E5.DataValueField = "CNO"
E5.DataBind()
End Sub
Sub S1S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox3.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F1.DataSource = dset1
F1.DataTextField = "DESIGNATION"
F1.DataValueField = "DESIGNATION"
F1.DataBind()
F11.DataSource = dset1
F11.DataTextField = "DESIGNATION"
F11.DataValueField = "DESIGNATION"
F11.DataBind()
F111.DataSource = dset1
F111.DataTextField = "DEPARTMENT"
F111.DataValueField = "DEPARTMENT"
F111.DataBind()
F1111.DataSource = dset1
F1111.DataTextField = "POSTING"
F1111.DataValueField = "POSTING"
F1111.DataBind()
F11111.DataSource = dset1
F11111.DataTextField = "CNO"
F11111.DataValueField = "CNO"
F11111.DataBind()
End Sub
Sub S2S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox4.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F2.DataSource = dset1
F2.DataTextField = "DESIGNATION"
F2.DataValueField = "DESIGNATION"
F2.DataBind()
F22.DataSource = dset1
F22.DataTextField = "DESIGNATION"
F22.DataValueField = "DESIGNATION"
F22.DataBind()
F222.DataSource = dset1
F222.DataTextField = "DEPARTMENT"
F222.DataValueField = "DEPARTMENT"
F222.DataBind()
F2222.DataSource = dset1
F2222.DataTextField = "POSTING"
F2222.DataValueField = "POSTING"
F2222.DataBind()
F22222.DataSource = dset1
F22222.DataTextField = "CNO"
F22222.DataValueField = "CNO"
F22222.DataBind()
End Sub
Sub S3S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox5.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F3.DataSource = dset1
F3.DataTextField = "DESIGNATION"
F3.DataValueField = "DESIGNATION"
F3.DataBind()
F33.DataSource = dset1
F33.DataTextField = "DESIGNATION"
F33.DataValueField = "DESIGNATION"
F33.DataBind()
F333.DataSource = dset1
F333.DataTextField = "DEPARTMENT"
F333.DataValueField = "DEPARTMENT"
F333.DataBind()
F3333.DataSource = dset1
F3333.DataTextField = "POSTING"
F3333.DataValueField = "POSTING"
F3333.DataBind()
F33333.DataSource = dset1
F33333.DataTextField = "CNO"
F33333.DataValueField = "CNO"
F33333.DataBind()
End Sub
Sub S4S(ByVal sender As Object, ByVal e As EventArgs)
on error resume next
Dim conn1 As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp1 As New OleDbDataAdapter("select * from STAFF where NAME like '" & textbox6.text & "%'" , conn1)
Dim dset1 As New Data.DataSet
adp1.Fill(dset1, "STAFF")
F4.DataSource = dset1
F4.DataTextField = "DESIGNATION"
F4.DataValueField = "DESIGNATION"
F4.DataBind()
F44.DataSource = dset1
F44.DataTextField = "DESIGNATION"
F44.DataValueField = "DESIGNATION"
F44.DataBind()
F444.DataSource = dset1
F444.DataTextField = "DEPARTMENT"
F444.DataValueField = "DEPARTMENT"
F444.DataBind()
F4444.DataSource = dset1
F4444.DataTextField = "POSTING"
F4444.DataValueField = "POSTING"
F4444.DataBind()
F44444.DataSource = dset1
F44444.DataTextField = "CNO"
F44444.DataValueField = "CNO"
F44444.DataBind()
End Sub
Dim str As String
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim dset As New Data.DataSet
str = "update POLLING set OFFICER='" & E1.Text & ", " & E2.TEXT & ", " & E3.TEXT & ", " & E4.TEXT & ", " & E5.TEXT & "', PRE1='" & F1.Text & ", " & F11.TEXT & ", " & F111.TEXT & ", " & F1111.TEXT & ", " & F11111.TEXT & "', PRE2='" & F2.Text & ", " & F22.TEXT & ", " & F222.TEXT & ", " & F2222.TEXT & ", " & F22222.TEXT & "', PRE3='" & F3.Text & ", " & F33.TEXT & ", " & F333.TEXT & ", " & F3333.TEXT & ", " & F33333.TEXT & "', PRE4='" & F4.Text & ", " & F44.TEXT & ", " & F444.TEXT & ", " & F4444.TEXT & ", " & F44444.TEXT & "' where GPU='" & D1.Text & "' AND WARD='" & D2.TEXT & "'"
If textbox1.text="road" then
Dim adp As New OleDbDataAdapter(str, conn)
adp.Fill(dset, "POLLING")
textbox1.text="RECORD SAVED"
Response.Redirect("EDIT.aspx")
conn.Close()
else
textbox1.text="wrong password"
End If
End Sub
Sub REPORT1(ByVal sender As Object, ByVal e As EventArgs)
Response.Redirect("REPORT.aspx")End Sub
Sub D1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING where GPU='" & D1.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D2.DataSource = dset
D2.DataTextField = "WARD"
D2.DataValueField = "WARD"
D2.DataBind()
End Sub
Sub D2F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")Dim adp As New OleDbDataAdapter("select * from POLLING where WARD='" & D2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D3.DataSource = dset
D3.DataTextField = "POLLINGNO"
D3.DataValueField = "POLLINGNO"
D3.DataBind()
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D3F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from POLLING where POLLINGNO='" & D3.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "POLLING")
D4.DataSource = dset
D4.DataTextField = "LOCATION"
D4.DataValueField = "LOCATION"
D4.DataBind()
End Sub
Sub D4F(sender As Object, e As System.EventArgs)
End Sub
Sub E1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from OFFICER where NAME='" & E1.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "OFFICER")
E2.DataSource = dset
E3.DataSource = dset
E4.DataSource = dset
E5.DataSource = dset
E2.DataTextField = "DESIGNATION"
E2.DataValueField = "DESIGNATION"
E3.DataTextField = "DEPARTMENT"
E3.DataValueField = "DEPARTMENT"
E4.DataTextField = "POSTING"
E4.DataValueField = "POSTING"
E5.DataTextField = "CNO"
E5.DataValueField = "CNO"
E2.DataBind()
E3.DataBind()
E4.DataBind()
E5.DataBind()
End Sub
Sub F1F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F1.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F11.DataSource = dset
F11.DataTextField = "DESIGNATION"
F11.DataValueField = "DESIGNATION"
F11.DataBind()
F111.DataSource = dset
F111.DataTextField = "DEPARTMENT"
F111.DataValueField = "DEPARTMENT"
F111.DataBind()
F1111.DataSource = dset
F1111.DataTextField = "POSTING"
F1111.DataValueField = "POSTING"
F1111.DataBind()
F11111.DataSource = dset
F11111.DataTextField = "CNO"
F11111.DataValueField = "CNO"
F11111.DataBind()
End Sub
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F2.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F22.DataSource = dset
F22.DataTextField = "DESIGNATION"
F22.DataValueField = "DESIGNATION"
F22.DataBind()
F222.DataSource = dset
F222.DataTextField = "DEPARTMENT"
F222.DataValueField = "DEPARTMENT"
F222.DataBind()
F2222.DataSource = dset
F2222.DataTextField = "POSTING"
F2222.DataValueField = "POSTING"
F2222.DataBind()
F22222.DataSource = dset
F22222.DataTextField = "CNO"
F22222.DataValueField = "CNO"
F22222.DataBind()
End Sub
Sub F3F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F3.text & "'", conn)Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F33.DataSource = dset
F33.DataTextField = "DESIGNATION"
F33.DataValueField = "DESIGNATION"
F33.DataBind()
F333.DataSource = dset
F333.DataTextField = "DEPARTMENT"
F333.DataValueField = "DEPARTMENT"
F333.DataBind()
F3333.DataSource = dset
F3333.DataTextField = "POSTING"
F3333.DataValueField = "POSTING"
F3333.DataBind()
F33333.DataSource = dset
F33333.DataTextField = "CNO"
F33333.DataValueField = "CNO"
F33333.DataBind()
End Sub
Sub F4F(sender As Object, e As System.EventArgs)
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & """" & "e:\ALOKRAJ\ELECTION.mdb" & """")
Dim adp As New OleDbDataAdapter("select * from STAFF where NAME='" & F4.text & "'", conn)
Dim dset As New Data.DataSet
adp.Fill(dset, "STAFF")
F44.DataSource = dset
F44.DataTextField = "DESIGNATION"
F44.DataValueField = "DESIGNATION"
F44.DataBind()
F444.DataSource = dset
F444.DataTextField = "DEPARTMENT"
F444.DataValueField = "DEPARTMENT"
F444.DataBind()
F4444.DataSource = dset
F4444.DataTextField = "POSTING"
F4444.DataValueField = "POSTING"
F4444.DataBind()
F44444.DataSource = dset
F44444.DataTextField = "CNO"
F44444.DataValueField = "CNO"
F44444.DataBind()
End Sub
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3" CellSpacing="2" DataKeyNames="ID" DataSourceID="AccessDataSource3" AutoGenerateEditButton="false" Width="672px">
Columns--
--asp:BoundField DataField="GPU" HeaderText="GPU" SortExpression="GPU" --
--asp:BoundField DataField="POLLINGNO" HeaderText="POLLINGNO" SortExpression="POLLINGNO" --
--asp:BoundField DataField="WARD" HeaderText="WARD" SortExpression="WARD" --
--asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" />
--asp:BoundField DataField="LOCATION" HeaderText="LOCATION" SortExpression="LOCATION" --
--Columns>
--RowStyle BackColor="#FFF7E7" ForeColor="#8C4510"---
--SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White"--
--PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
--HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White"--
--asp:GridView--
--asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="e:\ALOKRAJ\ELECTION.mdb"
SelectCommand="SELECT * FROM [POLLING]"--asp:AccessDataSource
____
asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="e:\ALOKRAJ\ELECTION.mdb"
SelectCommand="SELECT * FROM [OFFICER]" UpdateCommand="UPDATE [OFFICER] SET [NAME] = @NAME, [DESIGNATION] = @DESIGNATION, [CNO] = @CNO, [DEPARTMENT] = @DEPARTMENT, [POSTING] = @POSTING WHERE [ID] = @ID">
SelectCommand="SELECT * FROM [OFFICER]" UpdateCommand="UPDATE [OFFICER] SET [NAME] = @NAME, [DESIGNATION] = @DESIGNATION, [CNO] = @CNO, [DEPARTMENT] = @DEPARTMENT, [POSTING] = @POSTING WHERE [ID] = @ID">
_____
Crystal report.
Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR"
Namespace="CrystalDecisions.Web" TagPrefix="CR"
CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" --
--CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
--Report FileName="training.rpt"--
Report--
--CR:CrystalReportSource
Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" --
--CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
--Report FileName="training.rpt"--
Report--
--CR:CrystalReportSource
Make crystal report from table selection or quesry.
Web Configuration----
xml version="1.0"
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
--configuration
appSettings
add key="CrystalImageCleaner-AutoStart" value="true"
add key="CrystalImageCleaner-Sleep" value="60000"
add key="CrystalImageCleaner-Age" value="120000"
appSettings
connectionStrings
system.web
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
--configuration
appSettings
add key="CrystalImageCleaner-AutoStart" value="true"
add key="CrystalImageCleaner-Sleep" value="60000"
add key="CrystalImageCleaner-Age" value="120000"
appSettings
connectionStrings
system.web
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
compilation debug="true" strict="false" explicit="true"
assemblies
add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"--assemblies--compilation
pages
namespaces
clear
add namespace="System"
add namespace="System.Collections"
add namespace="System.Collections.Specialized"
add namespace="System.Configuration"
add namespace="System.Text"
add namespace="System.Text.RegularExpressions"
add namespace="System.Web"
add namespace="System.Web.Caching"
add namespace="System.Web.SessionState"
add namespace="System.Web.Security"
add namespace="System.Web.Profile"
add namespace="System.Web.UI"
add namespace="System.Web.UI.WebControls"
add namespace="System.Web.UI.WebControls.WebParts"
add namespace="System.Web.UI.HtmlControls"
namespaces
pages
----
----
--httpHandlers--add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"--httpHandlers--system.web--
--configuration--
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
compilation debug="true" strict="false" explicit="true"
assemblies
add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"--assemblies--compilation
pages
namespaces
clear
add namespace="System"
add namespace="System.Collections"
add namespace="System.Collections.Specialized"
add namespace="System.Configuration"
add namespace="System.Text"
add namespace="System.Text.RegularExpressions"
add namespace="System.Web"
add namespace="System.Web.Caching"
add namespace="System.Web.SessionState"
add namespace="System.Web.Security"
add namespace="System.Web.Profile"
add namespace="System.Web.UI"
add namespace="System.Web.UI.WebControls"
add namespace="System.Web.UI.WebControls.WebParts"
add namespace="System.Web.UI.HtmlControls"
namespaces
pages
----
----
--httpHandlers--add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"--httpHandlers--system.web--
--configuration--