Answered by:
Problem with Gridview in ODBC connection to MySQL

Question
-
User380024196 posted
Hi, I'm trying to connect an asp.net website with vb.net to a MySql database with ODBC connection. I can connect with the string "Driver={MySQL ODBC 3.51}; server=localhost;User Id=myid;password=mypasswd;database=mydb; option=3;"
The problem apears when I try to access some data with Gridview of any table. Apears the message "There are no support to key word: "driver". I tried with mysql driver 3.51 and 5.1 and .net 2.0 and 4.0. Same message.
In ADO I have no problem at all, but my host just accept ODBC.
Some idea of a way that I can solve this problem?...
Tanks.
PS: Sorry some english error.
Server Error in '/' Application.
There are no support to key word: 'driver'.
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: Não há suporte para a palavra-chave: 'driver'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Não há suporte para a palavra-chave: 'driver'.] System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5110868 System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98 System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +64 System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24 System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +150 System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +59 System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4 System.Web.UI.WebControls.SqlDataSource.CreateConnection(String connectionString) +34 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +117 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75 System.Web.UI.Control.EnsureChildControls() +102 System.Web.UI.Control.PreRenderRecursiveInternal() +42 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
Monday, September 5, 2011 5:54 PM
Answers
-
User380024196 posted
Hi... I figure out how to solve this.. I just put ProviderName="System.Data.ODBC" in my SqlDataSources, but only works with .net version 4.
Thanks anyway.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, September 8, 2011 2:53 PM
All replies
-
User380024196 posted
Hi... I figure out how to solve this.. I just put ProviderName="System.Data.ODBC" in my SqlDataSources, but only works with .net version 4.
Thanks anyway.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, September 8, 2011 2:53 PM -
User1342669201 posted
Thanks for sharing the solution, it works for me.
Thursday, October 20, 2011 8:38 AM