Advertisement
Guest User

yoav

a guest
Mar 9th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="loginGET.aspx.cs" Inherits="WebApplication1.loginGET" %>
  2.  
  3. <!DOCTYPE html>
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7. <title></title>
  8. </head>
  9. <body>
  10. <form id="form1" runat="server">
  11. <div>
  12. <%
  13. string username = Request["username"];
  14. string password = Request["password"];%>
  15. <%
  16. System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection();
  17. connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\WebApplication1\WebApplication1\studentlist.mdb";
  18. try
  19. {
  20. System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();
  21. command.Connection = connection;
  22. connection.Open();
  23.  
  24.  
  25.  
  26. command.CommandText = "SELECT * FROM liststud WHERE username='"+username+"' AND password='"+password+"'";
  27. System.Data.OleDb.OleDbDataReader reader = command.ExecuteReader();
  28. %> <div>
  29. <table border="1">
  30. <tr><% while (reader.Read()) {
  31. %>
  32.  
  33.  
  34. <td>
  35. <%= reader[0].ToString() %>
  36.  
  37. </td>
  38.  
  39. <td>
  40. <%= reader[1].ToString() %>
  41.  
  42. </td>
  43.  
  44. <td>
  45. <%= reader[2].ToString() %>
  46.  
  47. </td>
  48.  
  49. <td>
  50. <%= reader[3].ToString() %>
  51.  
  52. </td>
  53. <td>
  54. <%= reader[4].ToString() %>
  55.  
  56. </td>
  57.  
  58. <td ><img src="<%= reader[5].ToString() %>"/> </td>
  59.  
  60. <td>
  61. <%= reader[6].ToString() %>
  62.  
  63. </td>
  64. <td>
  65. <%= reader[7].ToString() %>
  66.  
  67. </td>
  68. </tr>
  69. <%
  70. }
  71. reader.Close();
  72. %> </table>
  73. </div><%
  74. }
  75. finally
  76. {
  77. connection.Close();
  78. }
  79.  
  80. %>
  81. </div>
  82. </form>
  83. </body>
  84. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement