I’m trying to open a data base on embed vb code. On the MyConnection.Open() I get a error saying
Warning 1 [rsRuntimeErrorInExpression] The Value expression for the
textrun ‘Textbox1.Paragraphs[0].TextRuns[0]’ contains an error:
Request for the permission of type
‘System.Data.SqlClient.SqlClientPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’
failed. C:\Users\tedpottel\Documents\Visual Studio
My datasource in the report is Data Source=(local);Initial Catalog=bw
vb code is:
Public Function TestData () As Boolean
Dim MyConnection As System.Data.SQLClient.SqlConnection
Dim MyCommand As System.Data.SQLClient.SqlCommand
MyConnection = New System.Data.SQLClient.SqlConnection("server=(local);Initial Catalog=bw")
MyConnection.Open()
MyConnection.Close()
return True
End Function
First result on Google for "System.Data.SqlClient.SqlClientPermission":
Follow the link for information on how to configure your code to run at full trust.