Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

SQLDataSource will not connect to MYSQL DB.

$
0
0

Hi,

I am trying to connect a Gridview to a MYSQL DB through a SQLDataSource. However, the SQLDataSource does not work or connect.  I get the following error when I try to test my query:

Could not create connection

Exception o type 'Microsoft.VisualStudio.Web.Data.InternalException' was thrown.

I can connect to MYSQL DB from the code behind like this, therefor I must have the MYSQLConnectors working:

Using myConnection As New MySqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString) ......

But my SQLDataSource configured like this does not work.

<asp:SqlDataSource ID="SqlDataSource1" runat="server" providerName="MySql.Data.MySqlClient"
ConnectionString="<%$ connectionStrings:ConnectionString %>"
SelectCommand="SELECT [email] FROM [my_aspnet_membership] ">

<SelectParameters>
<asp:Parameter Name="email" />
</SelectParameters>
</asp:SqlDataSource>

Please help?


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>