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.@> 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

    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;")

    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" ) & " !" )

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


    End Sub

    </script >

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

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


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

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

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


    <table border="0" align="center" cellpadding="2" cellspacing="0" width="293">
    <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"/>
    Runat="Server" display="dynamic">
    You must enter your login name!

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

    <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"/>




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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.