Unable to find the requested .Net Framework Data Provider. It may not be installed.

Discussion in 'Databases' started by codemonkey21, Jul 21, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I'm getting the below error. I've used the connection string provided by discountasp.net. The only thing that I can think of is that I'm using the hostedSQL Server 2000 and not 2005, but that doesn't seem right either. I'm using Visual Web Developer Express. Please help!

    -Mike
    Server Error in '/HAN' Application.


    Unable to find the requested .Net Framework Data Provider. It may not be installed.
    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: Unable to find the requested .Net Framework Data Provider. It may not be installed.

    Source Error:






    Code:
    Line 122:
    Line 123:        // Create a new data provider factory
    Line 124:        DbProviderFactory factory = DbProviderFactories.GetFactory(dataProviderName);
    Line 125:
    Line 126:        // Obtain a database specific connection object
    Source File: c:\Inetpub\HAN\App_Code\GenericDataAccess.cs Line: 124

    Stack Trace:






    Code:
    [ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
       System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +102
       GenericDataAccess.CreateCommand() in c:\Inetpub\HAN\App_Code\GenericDataAccess.cs:124
       UserAccess.AddUser(String email) in c:\Inetpub\HAN\App_Code\UserAccess.cs:59
       Signup.emailSubmit_Click(Object sender, EventArgs e) in c:\Inetpub\HAN\Signup.aspx.cs:44
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +97
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
    




    Version Information:Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
     
  2. Bruce

    Bruce DiscountASP.NET Staff

  3. From class GenericDataAccess




    // Create and prepares a new DbCommand object on a new connection


    public static DbCommand CreateCommand()


    {


    // Obtain the database provider name


    string dataProviderName = HotAtNightConfiguration.DbProviderName;


    // Obtain the database connection string


    string connectionString = HotAtNightConfiguration.DbConnectionString;


    // Create a new data provider factory


    DbProviderFactory factory = DbProviderFactories.GetFactory(dataProviderName);


    // Obtain a database specific connection object


    DbConnection conn = factory.CreateConnection();


    // Set the connection string


    conn.ConnectionString = connectionString;


    // Create a database specific command object


    DbCommand comm = conn.CreateCommand();


    // Set the command type of stored procedure


    comm.CommandType = CommandType.StoredProcedure;


    // Return the initialized command object


    return comm;


    }





    From class ApplicationConfiguration


    static HANConfiguration()


    {


    dbConnectionString = ConfigurationManager.ConnectionStrings["HANConnection"].ConnectionString;


    dbProviderName = ConfigurationManager.ConnectionStrings["HANConnection"].ProviderName;


    }


    // Returns the connection string for the HAN database


    public static string DbConnectionString


    {


    get


    {


    return dbConnectionString;


    }


    }


    // Returns the data provider name


    public static string DbProviderName


    {


    get


    {


    return dbProviderName;


    }


    }


    From Web.Config


    <connectionStrings>


    <add name="HANConnection" connectionString="Data Source=mssql05.discountasp.net; Initial Catalog=DB_68159;User ID=******;Password=******;" providerName="System.Data.SqlClient"/>


    </connectionStrings>
     
  4. Could you post the code snippet for HotAtNightConfiguration?I was just wondering whether the variabledataProviderName has a valid/correctvalue assigned to it?I believe may be you want to use ApplicationConfiguration instead of HotAtNightConfiguration to get the value for dataProviderName.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. I think you might be right. I think I tried naming it one thing, but had to rename it to the ApplicationConfiguration and must have forgot to adjust the names in this file. I'll check!

    -Mike
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page