0% found this document useful (0 votes)
35 views4 pages

Code For First Page: Imports Partial Class Inherits Protected Sub Byval As Object Byval As Handles Dim New

The document contains code for three ASP.NET web forms pages - a login page, registration page, and approval page - that access a Microsoft Access database called "myDb.mdb". The login page validates a user's credentials against the database. The registration page inserts a new user record into the database. The approval page updates an existing user record in the database to mark it as approved.

Uploaded by

anon-788714
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

Code For First Page: Imports Partial Class Inherits Protected Sub Byval As Object Byval As Handles Dim New

The document contains code for three ASP.NET web forms pages - a login page, registration page, and approval page - that access a Microsoft Access database called "myDb.mdb". The login page validates a user's credentials against the database. The registration page inserts a new user record into the database. The approval page updates an existing user record in the database to mark it as approved.

Uploaded by

anon-788714
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

CODE FOR FIRST PAGE

Imports [Link]

Partial Class _Default


Inherits [Link]

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As


[Link]) Handles [Link]
Dim dbconn, sql, dbcomm, dbread
dbconn = New
OleDbConnection("Provider=[Link].4.0;data source=" &
[Link]("[Link]"))
[Link]()
sql = "SELECT * FROM login where username = '" + [Link]
+ "' and password = '" + [Link] + "'"
dbcomm = New OleDbCommand(sql, dbconn)
dbread = [Link]()
If (Not [Link]()) Then
[Link] = "Not "
Else
[Link]("[Link]")
End If
End Sub
End Class

CODE for REGISTER PAGE

Imports [Link]
Partial Class register
Inherits [Link]

Protected Sub Page_Load(ByVal sender As Object, ByVal e As


[Link]) Handles [Link]

End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As


[Link]) Handles [Link]

Dim dbconn, sql, dbcomm, Raw ', dbread


dbconn = New
OleDbConnection("Provider=[Link].4.0;data source=" &
[Link]("[Link]"))
[Link]()
sql = "INSERT INTO register values('" + [Link] + "'," +
[Link] + ",0)"
[Link](sql)
dbcomm = New OleDbCommand(sql, dbconn)
Raw = [Link]()
End Sub
End Class
Code For APPROVE PAGE

Imports [Link]

Partial Class approve


Inherits [Link]

Protected Sub Page_Load(ByVal sender As Object, ByVal e As


[Link]) Handles [Link]
Dim dbconn, sql, dbcomm
dbconn = New
OleDbConnection("Provider=[Link].4.0;data source=" &
[Link]("[Link]"))
[Link]()
sql = "UPDATE register set approved =1 where name ='" &
[Link]("id") & "'"
dbcomm = New OleDbCommand(sql, dbconn)
[Link]()
[Link] = [Link]("id") & " is Approved"
End Sub
End Class

You might also like