Friday, February 24, 2012

Error while using first time!

I'm trying to learn about SQL databases and use them for my asp.net app sine I cant get the hang of MySQL in ASP. Every time I go to create a new SQL Database it saids: Would you like to place it in the App_Data folder basicly and I say yes. Then the error:

Unable to find DbProivderFactory for type System.Data.SqlClient.SqlConnection

Hi Clanstyles,

Based on the error message, I think the provider factory was not installed properly on you machine. Or the configuration files might not be written correctly.

Please try the following:

1. Open machine.config file under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
2. Check the nodes under configuration/system.data/DbProviderFactories to see if all the provider has been installed successfully. It has to look like this.

<DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</DbProviderFactories>

HTH.

No comments:

Post a Comment