Jump to content

Recommended Posts

Posted

Sorry for the next post. I actually resolved the previous errors; I just bypassed it altogether.

 

However, I need to connect to my MySQL database. And it appears that I cannot connect. I get "Cannot validate data" errors or an error saying that the initialization string for the Mysql Connect is wrong.

 

Snippet of webconfig:

 

<configuration>
 <appSettings>

 <add key="connString" value="Server=johnny.heliohost.org;Database=custer_Simon2;Uid=custer_user;Pwd=*******;" />

 </appSettings>
<connectionStrings/>
<system.web>
....and so on

 

I have made the user custer_user, and have given that account full privileges. I have also enabled remote MySQL access (% character used). I have tried using Port and Driver in the above connection string as well, but I receive errors saying they are not valid keywords.

 

.aspx snippet of implementation:

 

                Dim sqlConn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("connString"))
	sqlConn.Open()
               Dim sqlComm As New SqlCommand("INSERT INTO Users " & _ and so on

 

This was working fine with my offline server. So what needs to be changed to work on this server?

 

Sorry for all the questions. Thank you very much.

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

Guest Geoff
Posted

Can you post the Stack Trace?

Posted

Sure. I figured I was trying to connect to MS SQL, so I changed it to MySQL, but I keep getting this error:

 

Unrecognized attribute 'providerName'. (/home/custer/public_html/web.config line 3)

Description: HTTP 500. Error processing request.

 

Stack Trace:

 

System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'providerName'. (/home/custer/public_html/web.config line 3)

at System.Configuration.ConfigurationElement.DeserializeElement (System.Xml.XmlReader reader, Boolean serializeCollectionKey) [0x00000] in <filename unknown>:0

at System.Configuration.ConfigurationElementCollection.OnDeserializeUnrecognizedElement (System.String elementName, System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0

at System.Configuration.ConfigurationElement.DeserializeElement (System.Xml.XmlReader reader, Boolean serializeCollectionKey) [0x00000] in <filename unknown>:0

at System.Configuration.AppSettingsSection.DeserializeElement (System.Xml.XmlReader reader, Boolean serializeCollectionKey) [0x00000] in <filename unknown>:0

at System.Configuration.ConfigurationSection.DoDeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0

at System.Configuration.ConfigurationSection.DeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0

at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, Boolean createDefaultInstance) [0x00000] in <filename unknown>:0

at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0

at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0

at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0

at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0

at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem

.GetSection (System.String configKey) [0x00000] in <filename unknown>:0

at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0

at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0

at System.Web.Configuration.WebConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0

at System.Web.Compilation.BuildManager.LoadVirtualPathsToIgnore () [0x00000] in <filename unknown>:0

at System.Web.Compilation.BuildManager..cctor () [0x00000] in <filename unknown>:0

 

But that resulted from me adding the providerName attribute, but that is no longer present, and I restored things to the way they were, and I am still getting this error. It's becoming rather frustrating.

Guest Geoff
Posted

Hmm...

 

Mono applications are compiled, so this could be why you are still getting this error.

Guest Geoff
Posted

This support request is being escalated to our root admin.

Posted

Don't know if my problem is same kind as the creator of this thread but it seems to be the most propriet to post in.

I'm trying to deploy my site and I'm getting this error after upload all the stuff.

 

Failed to find or load the registered .Net Framework Data Provider.

Description: HTTP 500. Error processing request.

Stack Trace:

System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.
  at System.Data.Common.DbProviderFactories.GetFactory (System.Data.DataRow providerRow) [0x00000] in <filename unknown>:0 
  at System.Data.Common.DbProviderFactories.GetFactory (System.String providerInvariantName) [0x00000] in <filename unknown>:0 
  at NHibernate.Driver.ReflectionBasedDriver..ctor (System.String providerInvariantName, System.String driverAssemblyName, System.String connectionTypeName, System.String commandTypeName) [0x00000] in <filename unknown>:0 
  at NHibernate.Driver.MySqlDataDriver..ctor () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

 

On localhost everything is fine, connection with database works perfectly (used Connector/Net).

I'd to add some lines of code to machine.config though

 

<system.data>
    <DbProviderFactories>
      ...
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>

 

Probably the problem is with missing MySql.Data.dll or with the version of this library on Johnny.

I've ran into a some sort of idea how to solve this problem without troubling the server admins but it didn't work for me

(or maybe I'm doing something wrong). Here is link to this thread (look at Robert Simpson post)

 

Faild to load .NET Framework Data Provider

 

 

Posted

Apologies; MySQL's Connector/NET wasn't installed at that point. I've installed it now. Does your script work properly now? mysql.data.dll is now installed in the GAC.

Posted

Still same problem

 

@djbob

Did you add something like this to the machine.config? Of course depending of the version You've installed.

 

<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

 

I've tryied with above code in my web.config and without it. Unfortunately the problem is still there.

 

Stack trace WITHOUT added DbProviderFactories to web.config

 

Failed to find or load the registered .Net Framework Data Provider 'MySql.Data.MySqlClient'.

Description: HTTP 500. Error processing request.

Stack Trace:

System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider 'MySql.Data.MySqlClient'.
  at System.Data.Common.DbProviderFactories.GetFactory (System.String providerInvariantName) [0x00000] in <filename unknown>:0 
  at NHibernate.Driver.ReflectionBasedDriver..ctor (System.String providerInvariantName, System.String driverAssemblyName, System.String connectionTypeName, System.String commandTypeName) [0x00000] in <filename unknown>:0 
  at NHibernate.Driver.MySqlDataDriver..ctor () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

 

Stack trace WITH is same as I posted before

 

 

 

Posted

Good call! Forgot to add it to the DbProviderFactories in machine.config. Is it working now?

Posted

Nothing changed

 

Only when I'm adding by myself (in web.config) lines with DbProvider error message says that there already exist one with same name.

So i guess that You've been successful on adding these lines into machine.config.

 

Really don't know why this isn't working :/

 

Any ideas ?

Posted

Let's see if an Apache restart fixes it up. Give it about 12 hours and let me know if the problem persists at that point.

Guest
This topic is now closed to further replies.

×
×
  • Create New...