Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 4th, 2011, 9:12 AM   #1
Evil-Dog
Programmer
 
Join Date: Mar 2011
Posts: 36
Rep Power: 0 Evil-Dog is on a distinguished road
Access Database In ASB.NET

I have a database called LoginTest.mdb, and a table called tblStaff, but i;m having trouble setting up the login script, in the table the fields are S_ID, UserName, Password

Web.Config Syntax (Toggle Plain Text)
  1. <?xml version="1.0"?>
  2.  
  3. <!--
  4. For more information on how to configure your ASP.NET application, please visit
  5. http://go.microsoft.com/fwlink/?LinkId=169433
  6. -->
  7.  
  8. <configuration>
  9. <connectionStrings>
  10. <add name="ApplicationServices"
  11. connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=DataDirectory|\LoginTest.mdb;Persist Security Info=False;"
  12. providerName="System.Data.SqlClient"/>
  13. </connectionStrings>
  14.  
  15. <system.web>
  16. <customErrors mode="On"
  17. defaultRedirect="error.aspx">
  18. <error statusCode="403" redirect="403.aspx" />
  19. <error statusCode="404" redirect="404.aspx" />
  20. </customErrors>
  21. <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  22.  
  23. <authentication mode="Forms">
  24. <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
  25. </authentication>
  26.  
  27. <membership>
  28. <providers>
  29. <clear/>
  30. <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
  31. enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
  32. maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
  33. applicationName="/" />
  34. </providers>
  35. </membership>
  36.  
  37. <profile>
  38. <providers>
  39. <clear/>
  40. <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
  41. </providers>
  42. </profile>
  43.  
  44. <roleManager enabled="false">
  45. <providers>
  46. <clear/>
  47. <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
  48. <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
  49. </providers>
  50. </roleManager>
  51.  
  52. </system.web>
  53.  
  54. <system.webServer>
  55. <modules runAllManagedModulesForAllRequests="true"/>
  56. </system.webServer>
  57. </configuration>

Login.aspx Syntax (Toggle Plain Text)
  1. <%@ Page Title="Log In" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
  2. CodeBehind="Login.aspx.vb" Inherits="ASPtest.Login" %>
  3. <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
  4. </asp:Content>
  5. <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
  6. <h2>
  7. Log In
  8. </h2>
  9. <p>
  10. Please enter your username and password.
  11. <asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="false">Register</asp:HyperLink> if you don't have an account.
  12. </p>
  13. <asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false">
  14. <LayoutTemplate>
  15. <span class="failureNotification">
  16. <asp:Literal ID="FailureText" runat="server"></asp:Literal>
  17. </span>
  18. <asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="failureNotification"
  19. ValidationGroup="LoginUserValidationGroup"/>
  20. <div class="accountInfo">
  21. <fieldset class="login">
  22. <legend>Account Information</legend>
  23. <p>
  24. <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label>
  25. <asp:TextBox ID="UserName" Name="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
  26. <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
  27. CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required."
  28. ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
  29. </p>
  30. <p>
  31. <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
  32. <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
  33. <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
  34. CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
  35. ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator>
  36. </p>
  37. <p>
  38. <asp:CheckBox ID="RememberMe" runat="server"/>
  39. <asp:Label ID="RememberMeLabel" runat="server" AssociatedControlID="RememberMe" CssClass="inline">Keep me logged in</asp:Label>
  40. </p>
  41. </fieldset>
  42. <p class="submitButton">
  43. <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup"/>
  44. </p>
  45. </div>
  46. </LayoutTemplate>
  47. </asp:Login>
  48. </asp:Content>
Evil-Dog is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.net and Access database integration 47states Visual Basic .NET 4 Jan 21st, 2011 11:09 PM
Is using MS Access to create a database for my site secure? josh305 Databases 3 Jan 3rd, 2011 7:00 PM
VB.net saving data to an Access database 47states Visual Basic .NET 0 Nov 27th, 2009 10:10 PM
searching an access database? designXperts.net Visual Basic .NET 12 Nov 27th, 2005 5:03 PM
java and MS Access database borceivanovski Java 0 Apr 26th, 2005 4:28 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:42 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC