0

I have written a controller in asp.net for retrieving data from mysql DB. While running it shows error such that is,

 Source Error: 

Line 7:    <configSections>
Line 8:      <!-- For more information on Entity Framework configuration, visit    
http://go.microsoft.com/fwlink/?LinkID=237468 -->
Line 9:      <section name="MySQLRoleProvider"  
type="MySql.Web.Security.MySQLRoleProvider,   
MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" 
connectionStringName="YourconnectionstringName" applicationName="LoginControl" />
Line 10:   </configSections>
Line 11:   <connectionStrings>

And my web.config file is following

 <?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->

<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit 
http://go.microsoft.com/fwlink/?LinkID=237468 -->

<section name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, 
MySql.Web, Version=5.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"  
connectionStringName="YourconnectionstringName" applicationName="LoginControl" />

</configSections>
<connectionStrings>
<remove name="LocalMySqlServer"/>
<add name="LocalMySqlServer" 
 connectionString="server=localhost:3306;uid=root;pwd=;database=test;"/>
</connectionStrings>


< appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
  <forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
<pages>
  <namespaces>
    <add namespace="System.Web.Helpers" />
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Optimization" />
    <add namespace="System.Web.Routing" />
    <add namespace="System.Web.WebPages" />
  </namespaces>
 </pages>
 </system.web>
 <system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules runAllManagedModulesForAllRequests="true" />
 <  handlers>
  <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
  <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." 
  verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" 
  scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" 
  preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
  <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." 
  verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" 
  scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" 
  preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*."
 verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
 type="System.Web.Handlers.TransferRequestHandler" 
 preCondition="integratedMode,runtimeVersionv4.0" />
 </handlers>
 </system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory  
type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="v11.0" />
  </parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>

And then I don't cognize how to connect mysql DB using this file. Because I tried with a lot of ways but I couldn't.

please anybody help

1 Answer 1

1

There is great resource with connection strings that can help you.

Sign up to request clarification or add additional context in comments.

1 Comment

The resource contains Data source only. ... Is there any other source for full illumination

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.