Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="loginGET.aspx.cs" Inherits="WebApplication1.loginGET" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <%
- string username = Request["username"];
- string password = Request["password"];%>
- <%
- System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection();
- connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\WebApplication1\WebApplication1\studentlist.mdb";
- try
- {
- System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();
- command.Connection = connection;
- connection.Open();
- command.CommandText = "SELECT * FROM liststud WHERE username='"+username+"' AND password='"+password+"'";
- System.Data.OleDb.OleDbDataReader reader = command.ExecuteReader();
- %> <div>
- <table border="1">
- <tr><% while (reader.Read()) {
- %>
- <td>
- <%= reader[0].ToString() %>
- </td>
- <td>
- <%= reader[1].ToString() %>
- </td>
- <td>
- <%= reader[2].ToString() %>
- </td>
- <td>
- <%= reader[3].ToString() %>
- </td>
- <td>
- <%= reader[4].ToString() %>
- </td>
- <td ><img src="<%= reader[5].ToString() %>"/> </td>
- <td>
- <%= reader[6].ToString() %>
- </td>
- <td>
- <%= reader[7].ToString() %>
- </td>
- </tr>
- <%
- }
- reader.Close();
- %> </table>
- </div><%
- }
- finally
- {
- connection.Close();
- }
- %>
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement