Connector/Net Connection String Options Reference
1935
myconn.Open();
12. Retrieve some data from your tables:
MySqlCommand cmd = new MySqlCommand("Select * from products", myconn);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataSet1 tds = new DataSet1();
da.Fill(tds, tds.Tables[0].TableName);
GridView1.DataSource = tds;
GridView1.DataBind();
myconn.Close()
13. Run the program. It should execute successfully, without requiring any special code or
encountering any security problems.
20.2.5.19.3. Configuring Partial Trust with Connector/Net Library Not Installed in GAC
When deploying a web application to a Shared Hosted environment, where this environment is
configured to run all their .NET applications under a partial or medium trust level, you might not be able
to install the Connector/Net library in the GAC. Instead, you put a reference to the library in the
bin
or
lib
folder inside the project or solution. In this case, you configure the security in a different way than
when the library is in the GAC.
Connector/Net is commonly used by applications that run in Windows environments where the default
communication for the protocol is used via sockets or by TCP/IP. For this protocol to operate is
necessary have the required socket permissions in the web configuration file as follows:
1. Open the medium trust policy web configuration file, which should be under this folder:
%windir%\Microsoft.NET\Framework\{
version
}\CONFIG\web_mediumtrust.config
Use
Framework64
in the path instead of
Framework
if you are using a 64-bit installation of the
framework.
2. Locate the
SecurityClasses
tag:
<SecurityClass Name="SocketPermission"
Description="System.Net.SocketPermission, System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
3. Scroll down and look for the following
PermissionSet
:
<PermissionSet version="1" Name="ASP.Net">
4. Add the following inside this
PermissionSet
:
<IPermission class="SocketPermission" version="1" Unrestricted="true" />
This configuration lets you use the driver with the default Windows protocol TCP/IP without having
any security issues. This approach only supports the TCP/IP protocol, so you cannot use any other
type of connection.
Also, since the
MySQLClientPermissions
class is not added to the medium trust policy, you
cannot use it. This configuration is the minimum required in order to work with Connector/Net
without the GAC.
20.2.6. Connector/Net Connection String Options Reference
For usage information about connection strings, see
Section 20.2.5.2, “Creating a Connector/Net
Connection String”
. The first table list options that apply generally to all server configurations. The
options related to systems using a connection pool are split into a separate table.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...