Jump to content

Recommended Posts

Posted

Hello, I have a problem:

 

I can't connect to MySql with the connector:

 

ODBC

 

<asp:SqlDataSource ID="DataSourceDato" runat="server" ProviderName="System.Data.Odbc" SelectCommand="select * from cosa"

ConnectionString="DRIVER={MySQL ODBC 3.51 Driver};Server=localhost;Database=zarkios_prueba;User=zarkios_prueba;Password=***;Option=3;"></asp:SqlDataSource>

 

And shows the next error:

 

 

System.DllNotFoundException: libodbc.so

at (wrapper managed-to-native) System.Data.Odbc.libodbc:SQLAllocHandle (System.Data.Odbc.OdbcHandleType,intptr,intptr&)

at System.Data.Odbc.OdbcConnection.Open () [0x00000] in <filename unknown>:0

 

MySQL Client

 

<asp:SqlDataSource ID="DataSourceDato" runat="server" ProviderName="MySql.Data.MySqlClient"

SelectCommand="SELECT * FROM cosa"

ConnectionString="Server=localhost;Database=zarkios_prueba;

User=zarkios_prueba;Password=***;" />

 

And shows the next error:

 

 

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 System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactory () [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactoryInternal () [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.SqlDataSourceView.InitConnection () [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect (System.Web.UI.DataSourceSelectArguments arguments) [0x00000] in <filename unknown>:0

at System.Web.UI.DataSourceView.Select (System.Web.UI.DataSourceSelectArguments selectArgs, System.Web.UI.DataSourceViewSelectCallback callBack) [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.DataBoundControl.PerformSelect () [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.BaseDataBoundControl.DataBind () [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.GridView.DataBind () [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound () [0x00000] in <filename unknown>:0

at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls () [0x00000] in <filename unknown>:0

at System.Web.UI.Control.EnsureChildControls () [0x00000] in <filename unknown>:0

at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000] in <filename unknown>:0

at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000] in <filename unknown>:0

at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000] in <filename unknown>:0

at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000] in <filename unknown>:0

at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000] in <filename unknown>:0

at System.Web.UI.Page.ProcessLoadComplete () [0x00000] in <filename unknown>:0

at System.Web.UI.Page.InternalProcessRequest () [0x00000] in <filename unknown>:0

at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0

 

Am i doing something wrong?

Posted

ok, i have found the solution, i added the MySql.Data.dll to my project and i selected the option for copy the dll to the solution, and i put the reference of the dll directly on the dll, and now i have full access to the dll

Guest
This topic is now closed to further replies.
×
×
  • Create New...