Which version of VB is used in SSRS - vba

Which version of Visual Basic does SSRS support?
MSDN page says that you write Visual Basic in the report code but doesn't say much about the version.

Good question. Microsoft are not very clear about this. The RDL specification for SQL Server 2008 R2 states that expressions "are defined in a Visual Basic compatible syntax", but does not provide any other detail, except an obsolete link. There is also no mention of custom code other than .NET references for precompiled dlls.
Code written in a report is stored as text within the RDL file after it is deployed, which means that it is either interpreted on the fly or JIT-compiled when it the report is run. For this reason, if you have a large volume of, or intensive code, precompiling to a dll and referencing it in the report will offer better performance.

Related

VB.NET Application Performance Profiling Visual Studio 2019

I am trying to identify a performance issue with my application which is written in vb.net 4.6.1
When tried using microsoft performance profiler. It was pointing to an external code but when tried to understand what was the external code. It became really difficult. Refer below image for reference.

"Could not resolve mscorlib ... .NETFramework,Version=v2.0" in VS2015 from VB6

My question is similar to others, but my particular nuance of this problem doesn't appear to have an answer I can find on here so far, so here goes. (edits in italics)
Our company has a deployed application written in VB6. Since VB6 development is no longer officially supported in Windows, our company made the decision to port our VB6 application to VB.NET.
(Prior to this edit, I had mentioned that the project was converted to VB.NET using VS 2015. This was incorrect, I discovered that my coworker had actually performed the conversion using VS 2008, and I was working on the 2008 project in 2015.)
So we are now working with the VB.NET conversion in VS2015. As many of us know, the VS 2008 converter does an incomplete job porting VB6 code to VB.NET code so there are many, many errors to sort through (as of this writing, all compile errors are fixed). In particular, though, I'm trying to open the various forms for the project in the Designer so I can see and work with them. The designer specifically is reporting the error:
Could not resolve mscorlib for target framework '.NETFramework,Version=v2.0'. This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.
I saw some mention of a 256 character limit on dependency paths. This dependency is met in my case. I have also confirmed that .NET Framework 2.0 is installed and active in my instance of Windows. I have seen the recommendation to upgrade the .NET Framework version as well, which was successful in itself but did not resolve this mscorlib issue.
Full call stack for this error follows:
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUniverse..ctor(IDesignTimeAssemblyLoader assemblyLoader, IVsDesignTimeAssemblyResolution projectAssemblyResolution, IVsSmartOpenScope dispenser)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUniverse.GetUniverse(IDesignTimeAssemblyLoader assemblyLoader, IVsDesignTimeAssemblyResolution projectAssemblyResolution, IVsSmartOpenScope dispenser)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkProvider..ctor(IVsDesignTimeAssemblyResolution assemblyResolution, IDesignTimeAssemblyLoader assemblyLoader, TypeDescriptionProvider parentProvider, IVsSmartOpenScope openScope)
at Microsoft.VisualStudio.Design.VsTargetFrameworkProviderService.get_TargetFrameworkProvider()
at Microsoft.VisualStudio.Design.VsTargetFrameworkProviderService.GetProvider(Type type)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
How can I gain the ability to view my project in the Designer?
As far as I know, opening VB6 files in VB.NET will not work. You will have to make modifications in Visual Studio 6.0 or re-write the application in VB.NET/C#.
Older versions of Visual Studio (until 2008) had some converters but they never really worked as expected.
You can take a look at Visual Basic Tools for Visual Studio, it "allows to work with classic VB workspaces and projects within Visual Studio.", this will allow you to modify the VB6 project in a newer version of Visual Studio but the code will remain VB6.
Regarding your exact issue, others have reported that the following worked for them:
Remove and add back project references that have warnings.
Rebuild the project
Remove and add back Microsoft.Office.Core
Good luck!
As someone who has converted a number of VB6 applications to VB.Net, I always advise a full rewrite. The languages are just too different. You waste far too much time trying to resolve issues of this type.
Better still, just leave the VB6 application running as is.
Microsoft's VB6 support statement

Differences between the VS Ultimate and Express compilers

On my PC at work I have a license for Visual Studio Ultimate 2012 but at home I am using Visual Basic express, since I don't really need most of the advanced features.
However I was wondering if there is a difference in the VB.NET build that I create with Ultimate versus the build I do with Express.
I thought it was easy enough to test: Just build it with both versions and compare the .EXE files. I noticed that they were pretty much identical, but here and there I found little differences. ~10-12 bytes of the same value were a chain of 10-12 bytes of another value in the other .EXE and so on.
Are these just version identifiers or machine specific parameters or are there actual differences between the versions?
Some examples (same code, compiled on the same machine, just 1 minute apart so everything should be the same, both Release builds. Offsets are decimal.)
The .NET compilers are actually almost open source, via the Microsoft Shared Source Initiative. The compiler has nothing to do with the Visual Studio version you are using. Visual Studio, regardless of its version, it would use the same compiler. Theoretically, another IDE could also use the NET compiler. SharpDevelop is such an example.
The build outcome depends on some local machine properties and therefore you would find differences even if you used Visual Studio Ultimate in both machines.
in reality the differences in your compiled application will not have any difference at the user or operation level - at the binary level they will have different job ids /GUIDS etc.
also possibly defaulting authors (if you do not set the author for the program and you have visual studio set to default to the user's name this could change some visible binary)
overall functionally you should not see any difference as the compilers are compiling to the .net framework using the same final objective.

How to use a custom dotnet library method in SSRS of SQL Server 2008 R2?

I need to use a custom dll within my SSRS report. Please guide me how to do this in SQL Server 2008 R2 business intelligence studio.
Ok, the question is quite old, but as I had the same issue recently and as your question is not yet answered, i will give you a link that explains what to do
How to use custom assemblies or embedded code in Reporting Services
From you mail I suspect that you didn't deploy the dll on the server bin directory (and modifiy the config file).
Hope this will help you or someone else :-)
To reference a DLL, select the yellow background surrounding the report (in design view) and select Report Properties (not Report Data). Within here you have a Code section, for writing custom code and a References section to reference custom DLL's.
That said, if you want this functionality to be used by many reports, consider wrapping the SSRS reports within a c# web app. This will enable you to make use of common repeating code (like parameter passing) and reduce ongoing maintenance by code reuse.

How to edit default templates for database objects using VSTS 2008 Database Edition GDR Version

I'm giving Visual Studio Team System 2008 Database Edition (GDR Version) a go on a new project I'm working on and have come up against a slightly annoying problem that I am hoping someone knows how to resolve.
In a nutshell, I would like to alter the default templates used to generate database objects, particularly stored procedures. In the past, using SSMS, I have simply created my own templates which contain the formatting, default number of parameters, etc, that I would generally like to use whenever I create a new sproc. This obviously eliminates a good amount of hand coding and just "feels right" to me to have some consistency in my T-SQL code.
I've tried editing the .sql files located in ..\Microsoft Visual Studio 9.0\DBPro\Items by adding the formatting and default constructs I would like to use. Unfortunately, I haven't been able to get VSTS to recognize these changes. When I add a new stored procedure using the GUI it still uses the default stored procedure formatting.
I've tried shutting down Visual Studio and starting it back up after making these adjustments, but that doesn't seem to have any effect.
Does anyone know how to do this? I haven't been able to find any documentation on MSDN or the DBPro teams' blogs, but I have a feeling this can done. Any help or suggestions would be greatly appreciated.
Microsoft Visual Studio 9.0\DBPro\Items is a legacy directory. These are the wrong templates. The right templates are in Microsoft Visual Studio 9.0\VSTSDB\Extensions\SqlServer\Items. Editing these works, and you don't even have to close visual studio.