login page

Results 1 to 2 of 2

Thread: login page

  1. #1
    Join Date
    Dec 1969

    Default login page

    i'm currently building a login page that query the information from microsoft access databse. i'm using microsoft visual studio and C# for my code. i can't connet my database and my login page. can anyone give me a hand on it. thanx

  2. #2
    Join Date
    Dec 1969

    Default RE: login page

    Hmmm could be several things you need to correct so I will give a brief outline to check over:<BR><BR>1.) Be sure you have your web.config file right... the login url must be present for protected folders and files to know where to redirect unauthenticated users. Sounds like you are accessing your login in page directly so this prob isn&#039;t your particular problem. But here it is anyway.....<BR><BR>&#060;authentication mode="Forms"&#062;<BR> &#060;forms name="MyAuthNameForCookie" path="/" loginUrl="http://MyWeb.com/login.aspx" protection="All" timeout="30"&#062;&#060;/forms&#062;<BR>&#060;/authentication&#062;<BR><BR>2.)Make sure you have a correct connection string here is an example Access connection string for a local network....<BR><BR>"Provider=Microsoft.Jet.OLEDB.4 .0;Password=&#039;&#039;;User ID=MyId;Data Source=\Server1wwwrootMyWebdatabasesmainDatabase.m db"<BR><BR>Keep in mind that this string has to be changed when you upload your site to your hosting company as to reflect the new path to the database.<BR><BR>A few other tips are... <BR>put your connection string in the web.config file by using the appSettings tag....<BR>&#060;configuration&#062;<BR>&#060;appS ettings&#062;<BR>&#060;!--<BR>&#060;add key="MyDb" value="Provider=Microsoft.Jet.OLEDB.4.0;User ID=MyId;Data Source=\path used for my hosting company when site is uploadedmainDatabase.mdb;Persist Security Info=False"&#062;&#060;/add&#062;<BR>--&#062;<BR>&#060;add key="MyDb" value="Provider=Microsoft.Jet.OLEDB.4.0;Password=& #039;&#039;;User ID=MyId;Data Source=\Server1wwwrootMyWebdatabasesmainDatabase.m db"&#062;&#060;/add&#062;<BR>&#060;/appSettings&#062;<BR>&#060;/configuration&#062;<BR><BR>Notice I defined 2 strings one for when I work locally and another for when I upload my site to my hosting company.<BR>One advantage of this is when you need to access your connection string on a page you can just call it from the web config... another advantage is that when you upload your site to your webserver all you do is comment out your local connection string in the web.config and uncomment your hosting company connection string... notice the key value is the same in both connection strings "MyDb". Sure makes dealing with connection strings alot easier.<BR><BR>To call the connection string from the web.config when you need it, insert this code into the pages that need to use the connection string. <BR><BR>using System.Configuration;<BR>protected String ConnectionStringCalledFromWebconfig = ConfigurationSettings.AppSettings["MyDb"];<BR><BR>shorter version:<BR>protected String dsn = ConfigurationSettings.AppSettings["MyDb"];<BR><BR>The only other thing I can think of if your connection strings are correct... is if you can&#039;t access the login page? If so is it in a secure folder? Remember can&#039;t access anything in a secure folder until you login INCLUDING the login page.<BR><BR>hope this helps :)<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts