EvilDog
  •  EvilDog
  • 53% (Neutral)
  • YAF Forumling Topic Starter
2011-07-04T15:13:36Z
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.ArgumentException: Keyword not supported: 'provider'.
source error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
stack trace:
[ArgumentException: Keyword not supported: 'provider'.]
   System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5096356
   System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
   System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +64
   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +150
   System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +59
   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
   YAF.Classes.Data.MsSqlDbConnectionManager.InitConnection() +158
   YAF.Classes.Data.MsSqlDbConnectionManager..ctor() +37
   YAF.Classes.Data.LegacyDb.forumpage_initdb(String& errorStr, Boolean debugging) +106
   YAF.Core.Services.StartupInitializeDb.RunService() +82
   YAF.Core.Services.BaseStartupService.Run() +58
   YAF.Core.IHaveServiceLocatorExtensions.<RunStartupServices>b__2(IStartupService service) +29
   YAF.Utils.EnumerableExtensions.ForEach(IEnumerable`1 list, Action`1 action) +318
   YAF.Core.IHaveServiceLocatorExtensions.RunStartupServices(IHaveServiceLocator serviceLocator) +344
   YAF.Core.Services.PageRequestLoadServices.RequestedPage_PreInit(Object sender, EventArgs e) +68
   System.Web.UI.Page.OnPreInit(EventArgs e) +8938070
   System.Web.UI.Page.PerformPreInit() +31
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +328
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
ok here is my web.config
<?xml version="1.0"?>
<!--  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433  -->
<configuration>
  <configSections>
    <section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" requirePermission="false"/>
  </configSections>
  <connectionStrings configSource="db.config"/>
  <rewriter configSource="URLRewriter.config"/>
  <appSettings configSource="app.config"/>
  <system.web>
    <customErrors mode="Off" defaultRedirect="error.aspx">
      <error statusCode="403" redirect="403.aspx"/>
      <error statusCode="404" redirect="404.aspx"/>
    </customErrors>
    <compilation defaultLanguage="c#" debug="true" strict="false" explicit="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" name=".YAFNET_Authentication" protection="All" timeout="43200" cookieless="UseCookies"/>
    </authentication>
    <membership defaultProvider="YafMembershipProvider" hashAlgorithmType="SHA1">
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
        <clear/>
        <add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafMembershipProvider" requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider"/>
      </providers>
    </membership>
    <profile enabled="true" defaultProvider="YafProfileProvider">
      <providers>
        <clear/>
        <add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafProfileProvider" type="YAF.Providers.Profile.YafProfileProvider"/>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>
    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <clear/>
        <add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafRoleProvider" type="YAF.Providers.Roles.YafRoleProvider"/>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
      </providers>
    </roleManager>
    <pages validateRequest="false" smartNavigation="false" controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
      <controls>
        <!-- Default: use non-dynamic (compiled classes) in YAF -->
        <add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls"/>
        <add tagPrefix="YAF" namespace="YAF.Controls.Statistics" assembly="YAF.Controls"/>
        <add tagPrefix="YAF" namespace="YAF.Classes"/>
        <add tagPrefix="YAF" namespace="YAF"/>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </controls>
      <namespaces/>
    </pages>
    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add verb="GET" path="Resource.ashx" type="YAF.YafResourceHandler, YAF"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="YafTaskModule" type="YAF.Core.YafTaskModule, YAF.Core"/>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter"/>
    </httpModules>
  </system.web>
  <location path="login_db-protected.aspx">
    <system.web>
      <authorization>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>
  <system.net>
    <mailSettings>
      <smtp configSource="mail.config"/>
    </mailSettings>
  </system.net>
  <system.web>
    <trace enabled="false"/>
    <xhtmlConformance mode="Transitional"/>
    <!--  GLOBALIZATION
    This section sets the globalization settings of the application. 
    Utf-8 is not supported on Netscape 4.x 
    If you need Netscape compatibility leave iso-8859-1.
    UTF-8 is recommended for complex languages    -->
    <globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8"/>
    <!--<globalization culture="en-US" uiCulture="en"  fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"/>-->
    <!-- Set debug to "true" to test out the system in development -->
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <remove name="ScriptModule"/>
      <remove name="YafTaskModule"/>
      <remove name="UrlRewriter"/>
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="YafTaskModule" type="YAF.Core.YafTaskModule, YAF.Core" preCondition="managedHandler"/>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="YafHandler" preCondition="integratedMode" verb="GET" path="Resource.ashx" type="YAF.YafResourceHandler, YAF"/>
    </handlers>
  </system.webServer>
</configuration>
this is the db.config
<connectionStrings>
  <add name="yafnet"
       connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DataDirectory|\Website Database.mdb;Persist Security Info=False;"
       providerName="System.Data.OleDb"/>
  <add name="ApplicationServices"
       connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DataDirectory|\Website Database.mdb;Persist Security Info=False;"
       providerName="System.Data.OleDb"/>
</connectionStrings>
and these are the pages which are erroring =
<%@ Page Title="Log In" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
     CodeBehind="Login.aspx.vb" Inherits="ASPtest._Default" %>
<%@ Import Namespace="System.Windows.Forms" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
    Public Sub DisplayOleDbErrorCollection(exception As OleDbException)
        Dim i As Integer

        For i = 0 To exception.Errors.Count - 1
            MessageBox.Show("Index #" + i.ToString() + ControlChars.Cr _
               + "Message: " + exception.Errors(i).Message + ControlChars.Cr _
               + "Native: " + exception.Errors(i).NativeError.ToString() + ControlChars.Cr _
               + "Source: " + exception.Errors(i).Source + ControlChars.Cr _
               + "SQL: " + exception.Errors(i).SQLState + ControlChars.Cr)
        Next i
    End Sub
    Sub btnLogin_OnClick(Src As Object, E As EventArgs)
        Dim myConnection As OleDbConnection
        Dim myCommand As OleDbCommand
        Dim intUserCount As Integer
        Dim strSQL As String

        strSQL = "SELECT COUNT(*) FROM tblStaff " _
         & "WHERE u_name='" & Replace(txtUsername.Text, "'", "''") & "' " _
         & "AND u_pw='" & Replace(txtPassword.Text, "'", "''") & "';"

        myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " _
         & "Data Source=" & Server.MapPath("~/App_Data/LoginTest.mdb") & ";")

        myCommand = New OleDbCommand(strSQL, myConnection)

        myConnection.Open()
        intUserCount = myCommand.ExecuteScalar()
        myConnection.Close()

        'Response.Write(intUserCount)
        If intUserCount > 0 Then
            lblInvalid.Text = ""
            FormsAuthentication.SetAuthCookie(txtUsername.Text, True)
            Response.Redirect("login_db-protected.aspx")
        Else
            lblInvalid.Text = "Sorry... try again..."
        End If
    End Sub
</script>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>Please Login:</h2>
<p>
<asp:Label id="lblInvalid" runat="server" />
</p>

<form action="#">
    Username: <asp:TextBox id="txtUsername" runat="server" /><br />
    Password: <asp:TextBox id="txtPassword" TextMode="password" runat="server" /><br />
    <br />
    <asp:Button id="btnLogin" runat="server" text="Login" OnClick="btnLogin_OnClick" />
</form>
<p>
Here's the page we're protecting:
<a href="login_db-protected.aspx">login_db-protected.aspx</a>.
If you're not logged in, clicking the link will bounce
you right back to this page.
</p>
<hr />
<p>
Click <a href="http://www.asp101.com/samples/login_db_aspx.asp">here</a> to read about and download the source code.
</p>
</asp:Content>
<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" ValidateRequest="false" Inherits="YAF.ForumPageBase" %>
<%@ Import Namespace="System.Security.Cryptography" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Windows.Forms" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Register TagPrefix="YAF" Assembly="YAF" Namespace="YAF" %>
<script runat="server" type="text/C#">
    void Page_Load()
    {
        byte[] delay = new byte[1];
        RandomNumberGenerator prng = new RNGCryptoServiceProvider();

        prng.GetBytes(delay);
        Thread.Sleep((int)delay[0]);

        IDisposable disposable = prng as IDisposable;
        if (disposable != null) { disposable.Dispose(); }
    }
    public void DisplayOleDbErrorCollection(OleDbException exception)
    {
        for (int i = 0; i < exception.Errors.Count; i++)
        {
            System.Windows.Forms.MessageBox.Show("Index #" + i + "\n" +
                   "Message: " + exception.Errors[i].Message + "\n" +
                   "Native: " + exception.Errors[i].NativeError.ToString() + "\n" +
                   "Source: " + exception.Errors[i].Source + "\n" +
                   "SQL: " + exception.Errors[i].SQLState + "\n");
        }
    }
</script>
<asp:Content id="YafHead" runat="server" ContentPlaceHolderID="HeadContent">
    <meta id="YafMetaScriptingLanguage" http-equiv="Content-Script-Type" runat="server"
        name="scriptlanguage" content="text/javascript" />
    <meta id="YafMetaStyles" http-equiv="Content-Style-Type" runat="server" name="styles"
        content="text/css" />
    <meta id="YafMetaDescription" runat="server" name="description" content="Yet Another Forum.NET -- A bulletin board system written in ASP.NET" />
    <meta id="YafMetaKeywords" runat="server" name="keywords" content="Yet Another Forum.net, Forum, ASP.NET, BB, Bulletin Board, opensource" />
    <title></title>
</asp:Content>
<asp:Content ID="BodyContent"  runat="server" ContentPlaceHolderID="MainContent">
    <a href="/">
        <img src="~/forumlogo.jpg" runat="server" alt="logo" style="border: 0;" id="imgBanner" /></a>
    <br />
    <form id="form1" runat="server" enctype="multipart/form-data">
    <YAF:Forum runat="server" ID="forum" BoardID="1">
    </YAF:Forum>
    </form>
</asp:Content>
Sponsor

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved