Its hard because every year two times what is going to the developer, he explained that hosting company and complaining about medium trust level problem.

Microsoft explain step by step but still this problem doenst resolve WHY?

These steps are enough for developer. Why they are still complaining.

SOLUTION:

DONT USE DATAREADER WHEN YOU ARE BINDING YOUR DATA WITH DATAGRID, GRIDVIEW OR ANY CONTROL.

USE DATASET

NO need to follow below steps

NO need to do settings locally for your Application for Medium Trust Level.

Once you will deployed at hosted server, it will automatically inherit as medium trust level.

Microsoft said :

Summary of Steps

To use medium trust in your ASP.NET applications:

Step 1. Configure medium trust.

Step 2. Lock the trust level.

Step 3. Optionally create a custom policy based on medium trust.

Step 1. Configure Medium Trust

To configure an application to run with medium trust, add the following element to either the application of specific Web.config file in the virtual root directory of the application or to the machine-level Web.config file.

Copy Code

If there is a note: originUrl WebPermission by the permission of attributes, such as some can be used to limit connections to a defined set of addresses.

To configure all Web applications running on the server in the trust, this element of the machine-level Web.config file located in the following folder:% windir% Microsoft.NETFramework (version) configuration.

By default, Web applications are configured to work with full confidence, as run in the following default configuration from the machine-level Web.config file.

Copy Code

?

To review the full set of permissions available to medium trust applications, view the Web_mediumtrust.config file.

Step 2. Lock the Trust Level

Application service provider, or any run multiple websites on the same server application is responsible for medium-trust policy should be applied to the machine set-level Web.config file, and then locked for all Web application's trust level.

To do this, set the attribute to allowOverride

Copy Code

?

By setting allowOverride =

Yours comments are valuable for me

Joggee

http://blog.joggee.com