SSMS display issues

Recently I installed SQL Server Management Studio (SSMS) in a brand new laptop with a NVIDIA card.

Soon both myself and a colleague experienced some screen redraw issues.  Colors, toolbar buttons missing, nearly impossible to work with.

After installing and uninstalling several NVIDIA drivers, disabling 3d physics, changing compatibility modes for the SSMS.exe application and pulling whatever hair I have out trying to figure out a way to work with it, I found the solution for me…  maybe for you as well.

Options 2018-02-07 20.39.03 2018-02-07 20.50.03

Since then… no more funny colors or artifacts anywhere…

 

 

Visual Studio Quirks… Once a file filter always a file filter…

Thanks to Gui for this awesome fix…  Once you filter for file types in the global search.

To remove this annoying file type filter in visual studio, go to the registry editor

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Find

And modify the Filter key to be an empty string.

Slow performance on VMs hosted in Hyper V

Very disappointed after purchasing a fairly powerfull DELL server to find out that any network access to them (TCP/etc) was very very slow!!!!

Well I luckily found this blog article http://www.scotiasystems.com/blog/it-hints-and-tips/slow-network-performance-on-new-hyper-v-server/

And there finding that I was also using Broadcom NetXtreme Gigabit network cards, I simply switched this setting.

virtual-machine-queues_thumb

and BAAM!  Incredible difference!

SSMS Could not load file or assembly msmgdsrv, Version=9.0.0.0

Hi everyone,

Today I an into an error using SSMS while clicking on the button check for an MDX query, the error message was:
Could not load file or assembly ‘msmgdsrv, Version=9.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified. (MDXQueryGenerator)

After some investigations I found out that the path for the dll needs to be changed. To change the path open the file “%ProgramFiles%Microsoft SQL Server100ToolsBinnVSShellCommon7IDESsms.exe.config” with a text editor and find the line . Change the attribute of href to the actual dll, on my system it was C:Program FilesMicrosoft Analysis ServicesAS OLEDB10msmgdsrv.dll. Restart SSMS and then it works.

I hope this helps

Florian

Source: Microsoft.com

Connecting your LDAP to ClicData

With the February update (17/02) of ClicData comes the ability for our DataLoader to connect to your LDAP directory.

DataLoader can connect from any machine that is in the LDAP domain or outside of it as long as it can connect to the LDAP server.

Connect to any LDAP server using any credentials
Connect to any LDAP server using any credentials
You can also leave all the fields blank ; DataLoader will connect to the domain server as the current user
You can also leave all the fields blank ; DataLoader will connect to the domain server as the current user

Once the connection is established, you can use any standard LDAP filter to fetch anything you like.

That’s all there is to it – get data from your LDAP domain in ClicData in a matter of minutes!

LDAP Users imported into ClicData
LDAP Users imported into ClicData

Happy Dashboarding with ClicData!

How to use .NET WebBrowser to take screenshots

Do you need to take snapshot of some urls? You just want a headless browser? You are using .NET? You don’t want to rely on node/phantom or on a .net library (awesomium, cefsharp, webkitdotnet)? You love IE? Yes to all? This post is for you!

Because we can’t do a screenshot in modern browsers

If you have control of your webapplication / website that needs to take the screenshots, you know that is no such thing in current browser, no standard whatsoever (but the WebRTC is coming !). Maybe you encountered the client library : html2canvas (and  cansvg if you are dealing with svg) but this is not enough. It’s good for svg and canvas, but as soon as some html5 controls are in or complex style, it won’t do a nice job. You need a true browser that renders the page nicely, is waiting for ajax, pictures and so on, then call a method on it to get a snapshot.

Let’s emulate IE (yes, we want!)

Hopefully for you, .NET WebBrowser control is there. It is not suitable in every situation (take a coffee and read this stackoverflow post), but if you just want a snapshot of a given url, it won’t be a problem.

STAThread

First of all, you need a thread in STA (Single Thread Apartment) mode. If you want to take a snapshot from WCF or a console app, or any non-STA thread program, you need to create this kind of thread like this :

        Dim ARE As New AutoResetEvent(False)
        Dim tWebBrowserSnapshot As Bitmap = Nothing
        Dim t = New Thread(Sub()
                               Try
                                   Using tWebBrowser = New WebBrowser()
                                   ...
                                   End Using
                               Finally
                                   ARE.Set()
                               End Try
                           End Sub)
        t.SetApartmentState(ApartmentState.STA)
        t.Start()
        ARE.WaitOne()
        Return tWebBrowserSnapshot

Snapshot me

The browser is created, yeepee! You can now add some code to give it some style/size.

tWebBrowser.ScrollBarsEnabled = False
tWebBrowser.ScriptErrorsSuppressed = True
tWebBrowser.Width = myWidth
tWebBrowser.Height = myHeight
tWebBrowser.Navigate(myUrl)

Then you can take a snapshot because it has a nice method: DrawToBitmap.

Dim tBitmap = New Bitmap(tWebBrowser.Width, tWebBrowser.Height)
tWebBrowser.DrawToBitmap(tBitmap, New Rectangle(0, 0, tWebBrowser.Width, tWebBrowser.Height))

Snapshot logic

The main logic is there, but if you try that, you can run into severals issues. (such as blank image)

First, don’t forget that it’s a ‘true’ browser that renders the page. So, it takes time for it to load the page, then if it has ajax or images, it will call them, process the response etc. There is no magic flag that is set when everything is loaded on the page (to wait to call DrawToBitmap). WebBrowser has some events (such as DocumentCompleted) but it’s like the jquery $(document).on(‘ready’, fn), nothing is done yet. If you don’t know the targetted url, you don’t have a lot of choices :
– wait a finite amount of time to be almost sure everything is loaded
– maybe you can try to catch every ajax (by injecting some script into the document) the website is doing then count how many came back (but still, add a max timeout otherwise you could wait an infinite time).
– if you control the website on the url, create a variable that will be set to some value (true), and just wait for that.

Windows Registry is there for you

If you did that, you can still have blank pages. Why ? Because WebBrowser can use a old IE engine to render the page, which is not compatible. Because your server is up to date, you want to use IE11. To do that, you need to add a key in the registry.

HKEY_LOCAL_MACHINE
   SOFTWARE
      Microsoft
         Internet Explorer
            Main
               FeatureControl
                  FEATURE_BROWSER_EMULATION

Add a REG_DWORD with the process name (if you are using IIS, the process is w3wp.exe; if you are using a console app, put the name of your exe) and as data: 0x2AF9 (check msdn to see the possible values, IE10 is 0x2711).

IIS will help too

Last thing, if it’s a WCF that does the screenshot, and if you are using IIS, you need to change who is running the pool to LocalService.

Have a nice screenshot !

How to have aggregated results in a flat table

You have some nice data to display into a pivot table, but you can’t rank or format them so you are stuck ? Don’t worry!

We are currently working on the pivot table to include theses features (among others!), until then, here is a workaround using the flat table. And even more, you will learn new awesome stuff using the DataTransform feature.

For instance, let’s take a simple example with a table which has 2 columns : [Car Name] and [Quantity]. You want to display the sum of [Quantity] over [Car Name]. Basically in pure SQL it’s : sum(quantity) .. group by [Car Name] but this reduces the row count from 1000 to 5 for instance (if you have 5 cars), thus, this is not useable in DataTransform where it can just add/remove columns, ‘group by’ is not available.

What if we create a new column which is the sum of Quantity for each [Car Name] first ? Do you now the SQL “over” function ? This allows you to use aggregations that are computed for each row.

sum([Quantity]) over(partition by [Car Name])

Image

The computed column looks like :

Image

We can see that each value is repeated for each [Car Name]. (13, 6, and 8).

This is not yet useful in a flat table because of those repeated values. Let’s find a way to take only the first one. Because you can’t just remove rows in datatransform, we need to find a way to remove them using a filter on the dashboard instead.

Let’s create a new column that will help us to identify the first one for each group. To do that, we use generate a simple auto-incremented value (1, 2, .. ) and we will be able to just take the sum(Quantity) where this column equals 1 (each group will have its own sequence from 1 to n).

row_number() over(partition by [Car Name] order by [Car Name])

Image

The preview looks like :

Image

We can distinguish 5 groups : Alfa Romeo, AMC Hornet, Aston Martin, Bentley, BMW, and for each rownumber = 1, the sum of quantity : 13, 6, 8, 11, 8 (the sum is computed on the preview values only, not on the overall. It will be when you will process the transform). Thus, we can create our flat table from that and use ranking, filtering, format and so on.

Image

Image

Et voilà ! Happy Dashboarding !

Windows Server slow copy after installing NLB service

Hi everyone,

After installing the Microsoft load balancing service (NLB) between two servers we experienced a very slow copy rate when copying files/folder.
The problem was that the cluster were configured as Unicast, changing the setting to Multicast fixed the issue.

To change the setting connect to your cluster using the Network Load Balancing Manager tool then right click on the node cluster and select Cluster Properties.
Navigate to the Cluster Parameters tab and switch the parameter to Multicast.

NLB unicast multicast

More information about Unicast vs Multicast available here.
Hope this help.

Florian

Could not establish connection to IIS Server. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). (or Invalid namespace)

You are setting up a new server with IIS and you have another server doing remote stopping/starting of the websites, and you’re getting the following error:

Could not establish connection to IIS Server. Access is denied.

or

Could not establish connection to IIS Server. Invalid namespace.

In my case, our FinalBuilder server was throwing this error trying to stop a remote IIS website.

What you need to do is enable the IIS Management Scripts and Tools role of your IIS server:

iismanagementscriptandtools