Last post Sep 10, 2014 08:45 AM by skunapareddy
Sep 09, 2014 11:38 AM|skunapareddy|LINK
I am unable to run an .rdlc report from aspx page. I am having code in the code module to make a column into hyperlink in that report. It is trying to connect to database from within code. When I run the report I am getting the following error:
The report references the code module 'system.data version = 126.96.36.199 culture = nuetral...' which is not a trusted assembly.
The report code is as follows:
Public Shared Function OpenMEO(ByVal inMEO As String) As String
Dim rootWebConfig As System.Configuration.Configuration
rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/ESSGateKeeper")
Dim strConnString As System.Configuration.ConnectionStringSettings
strConnString.ConnectionString = rootWebConfig.ConnectionStrings.ConnectionStrings("AEMESS001DEVConnectionString").ConnectionString
Dim con As New System.Data.SqlClient.SqlConnection(strConnString.ConnectionString)
Dim qry = "Select MEOPATH from dbo.udf_GetMEOpath(@inMEO)"
' Dim cmd As New System.Data.SqlClient.SqlCommand(qry, con)
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandText = "Select MEOPATH from dbo.udf_GetMEOpath(@inMEO)"
Dim MPath As String
'cmd.CommandType = System.Data.SqlClient.SqlCommand.CommandType.Text
MPath = cmd.ExecuteScalar()
Catch ex As Exception
Can anyone please help me. I appreciate any help you can give me. Regards, Suma
Sep 10, 2014 04:31 AM|George Hua - MSFT|LINK
Welcome to MSDN forum.
Because Local Reports like SQL Server Reporting Services reports are written using open format (Report Definition Language (RDL)). Any user can add any code or reference any
assembly from your rdl file at the production environment which would cause a BIG security hole. You need to mark these assemblies as trusted inside your Windows Application code. Or you would get an error like this
The report references the code Module 'System.Data, Version=188.8.131.52, Culture=neutral, Publickey Token=b77a5XXXXXXXX', which is not a trusted
You need to use the
method of the
LocalReport class. You can add the following line at the Form_load event handler of your windows application.
For more information, pelase refer to
Adding custom code to Local Reports in Visual Studio.NET 2005 (Problems & Solutions).
Sep 10, 2014 08:45 AM|skunapareddy|LINK
Good morning George,
I changed the target framework to 4.0 and it resolved the trusted assembly issue. Appreciate your help. Thank you for your time. Rgds, Suma