Imports System.Net Public Class CustomReportCredentials Implements Microsoft.Reporting.WebForms.IReportServerCredentials
' local variable for network credential Private strUserName As String Private strPassWord As String Private strDomainName As String Public Sub New(ByVal UserName As String, ByVal PassWord As String, ByVal DomainName As String) strUserName = UserName strPassWord = PassWord strDomainName = DomainName End Sub Public ReadOnly Property ImpersonationUser() As System.Security.Principal.WindowsIdentity Implements Microsoft.Reporting.WebForms.IReportServerCredentials.ImpersonationUser Get ' not use ImpersonationUser Return Nothing End Get End Property Public ReadOnly Property NetworkCredentials() As System.Net.ICredentials Implements Microsoft.Reporting.WebForms.IReportServerCredentials.NetworkCredentials Get ' use NetworkCredentials Return New NetworkCredential(strUserName, strPassWord, strDomainName) End Get End Property Public Function GetFormsCredentials(ByRef authCookie As System.Net.Cookie, ByRef userName As String, ByRef password As String, ByRef authority As String) As Boolean Implements Microsoft.Reporting.WebForms.IReportServerCredentials.GetFormsCredentials ' not use FormsCredentials unless you have implements a custom autentication. authCookie = Nothing password = authority = Nothing Return False End Function End Class
ServerReportUrl要指定SSRS的Report Server URL, 而不是Report Manager URL。因為這個URL的錯誤,讓我一直遇到404的錯誤.
ex: http://serverIP/ReportServer
Dim objParms As New System.Collections.ObjectModel.Collection(Of ReportParameter) objParms.Add(New ReportParameter("param1", "param1 value")) ReportViewer1.ServerReport.SetParameters(objParms)
******************** ****讀取ini file**** ******************** function getinit(mfilename,msection,mentry) local lcinifile,lcvalue,lcbuffer,luentryvalue,lnnumbytes
*-- DECLARE DLL statements for reading/writing to private INI files declare integer GetPrivateProfileString in Win32API ; string cSection, string cKey, string cDefault, string @cBuffer, ; integer nBufferSize, string cINIFile
local minivalue, mresult, mbuffersize mbuffersize = 255 minivalue = spac(mbuffersize) mresult=getprivateprofilestring(msection,mentry,"*NULL*",@minivalue,mbuffersize,mfilename) minivalue=substr(minivalue,1,mresult) if minivalue="*NULL*" minivalue=.null. endif return minivalue endfun
- connection retry policy
- works great with async
- four modes
- DefaultExcutionStrategy
- DefaultSqlExecutionStrategy
- DbExecutionStrategy
- SqlAzureExecutionStrategy
- throws RetryLimitExceededException
##Configuration
1 2 3 4 5 6 7 8
public class MyConfiguration : DbConfiguration { public MyConfiguration() { SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy(1, TimeSpan.FromSeconds(30))); } }
The type initializer for 'Microsoft.Web.Microsoft.Web.Deployment.DeploymentManager' threw an exception. The type initializer for 'Microsoft.Web.Microsoft.Web.Deployment.BuiltinTypesCache' threw an exception.
fix:
uninstall dbsqlpackage provider . this packages no longer support.