Login page


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Login page

  1. #1
    julian Guest

    Login page


    I am trying to develop a login page conected to an Access database without
    any luck.
    Could someone help me?

  2. #2
    Johan Roosen Guest

    Re: Login page


    "julian" <vb.@127.0.0.1> wrote:
    >
    >I am trying to develop a login page conected to an Access database without
    >any luck.
    >Could someone help me?


    What exactly is the problem ?

  3. #3
    julian Guest

    Re: Login page


    I am getting this error:
    *************************************************

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    No data exists for the row/column.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information about
    the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: No data exists for the
    row/column.

    Source Error:


    Line 17: myDataReader = myCommand.ExecuteReader()
    Line 18:
    Line 19: If myDataReader.Item( "login" ) = txtLogin.Text Then
    Line 20:
    Line 21: Response.Write("Hello " & myDataReader.Item( "login" ) & " !" )

    *****************************************************
    And this is my code:
    ***************************

    <%@ Page Language=VB Debug=true %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Data.OLEDB" %>

    <script runat=server>

    Sub btnSubmit_Click(sender As System.Object, e As System.EventArgs)

    Dim myConnection As OleDbConnection
    Dim myCommand As OleDbCommand
    Dim myDataReader As OleDbDataReader

    myConnection = New OleDbConnection("PROVIDER= Microsoft.Jet.OLEDB.4.0;
    DATA SOURCE= d:\wwwclass\cart.mdb;")
    myConnection.Open()

    myCommand = New OleDbCommand("Select login, password From users ", myConnection)

    myDataReader = myCommand.ExecuteReader()

    If myDataReader.Item( "login" ) = txtLogin.Text Then

    Response.Write("Hello " & myDataReader.Item( "login" ) & " !" )

    Else
    lblFback.Text="Unsuccesful Login! Try Again"
    End If

    myDataReader.Close()
    myConnection.Close

    End Sub

    </script >

    <html>
    <head><title>Admin Login Form</title>

    <link rel="stylesheet" href="main.css" type="text/css">


    </head>
    <body>

    <FORM name="login1" method="post" action="login.aspx" Runat="Server">

    <h4 align="center"> Admin Login Form <br>

    <asp:Label id="lblFback" runat="server" />

    </h4>

    <table border="0" align="center" cellpadding="2" cellspacing="0" width="293">
    <tr>
    <th algin="right" valign="top" width="130" align="right" valign="middle"
    nowrap>Login Name</th>
    <td width="155" valign="top">
    <asp:TextBox id="txtLogin" Runat="Server"/>
    <asp:RequiredFieldValidator
    ControlToValidate="txtLogin"
    Runat="Server" display="dynamic">
    You must enter your login name!
    </asp:RequiredFieldValidator>
    </td>
    </tr>

    <tr>
    <th algin="right" valign="top" width="130" align="right" valign="middle"
    nowrap>Password</th>
    <td width="155" valign="top">
    <asp:TextBox id="txtPassword" runat="server"/>
    <asp:RequiredFieldValidator
    ControlToValidate="txtPassword"
    Runat="Server" display="dynamic">
    You must enter your password!
    </asp:RequiredFieldValidator>

    </td>
    </tr>
    <tr>
    <td algin="right" valign="middle" width="130"></td>
    <td align="center" valign="middle" width="155">
    <asp:button runat="server" id="submit1" text="Login" OnClick="btnSubmit_Click"/>

    </td>
    </tr>
    </table>

    </FORM>

    </body>
    </html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center