Search This Blog


Thursday, December 1, 2016

SQL Server Management Studio - Keyboard shortcut CTRL+K, CTRL+C not working

Keyboard shortcuts speed up development tasks in order to get more productive results. I encountered this problem that some keyboard shortcuts stopped working like CTRL+K, CTRL+C is not commenting the selected text, and it seemed unaffected. There could be two possible reasons which may cause this behavior:

  • First check if you have any add-ins installed? Perhaps this is the cause of making default shortcuts not working as expected because an add-in has taken over the control.
  • Second, check the keyboard scheme under Tools > Options > Environment > Keyboard. In my case, it has been switched to SQL Server 2000 you might try switching it back to Standard.

Tuesday, November 15, 2016

Error while publishing LightSwitch Application - 'Web deployment task failed. (This access control list is not in canonical form and therefore cannot be modified.)'

I used to publish my LightSwitch application to a certain location (my folder name is 'IMS2') in wwwroot directory. I have windows 10 installed with Visual Studio 2012 Ultimate. Everything was working smoothly, until I mistakenly deleted the target folder (IMS2), after that when I try to publish LightSwitch application, it starts giving me following error:

Web deployment task failed. (This access control list is not in canonical form and therefore cannot be modified.) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets

After searching and multiple tries I found following two options solved my problem.

  • First, probably the account doesn't have permissions to the target folder (IMS2) you are trying to publish to. Try to publish to a different folder.
  • Second, try reordering the permissions for target folder in IIS Web Server. For this follow these steps:

    1. Open IIS Web Server and select the target website node which is being created by LightSwitch publish wizard.
    2. Right-click on it and select Edit Permissions.

    3. It opens up following dialog box, go to the Security tab, it will prompts that permissions are not incorrectly ordered. Click the OK button.

    4. Within the Security tab, Click the Edit button as shown below:

    5. It will show the following popup asking for Reorder permissions. Click on Reorder button.

    And its done, now restart your Visual Studio instance and try publish the LightSwitch application. This time it should publish your application successfully.

Monday, November 7, 2016

Crystal Reports - Arabic Text or RTL language not showing special characters in correct way.

While developing the Crystal Reports for Arabic language, I encountered the problem that if the Arabic text contains special characters like open/close parenthesis "()", square brackets "[]" or angle brackets "<>" etc., then it was not showing that text correctly while printing the reports. In this post I share what I did to fix my problem, in case if some one else encounter similar problem can benefit from.

For example, I have a text-object. Before setting this option, it was displaying text as follows:

To fix this formatting issue, please follow these steps:

  1. First right click on Text-Object and click on option "Format Object".

  2. Go to Paragraph Tab.

  3. In the Reading order section, check the option Right to Left. As shown below:

And its done. Now it should print the reports with special characters in appropriate state for RTL languages. As my text-object now display this way:

Monday, October 17, 2016

Crystal Reports - How to Suppress the Section/Group when Sub-Report is blank

You might encounter unwanted blank(white space) while printing in Crystal Report which contains one or more sub-report(s). You can follow these steps to get hide a blank section or group, if there are no records in sub-report(s).

  1. First right click on sub-report and click on option "Format Object".

  2. Go to "Subreport" tab and set the checkbox "Suppress Blank Subreport" as marked true.

  3. At this stage, sub-report will be hidden, but still you might see blank space on parent report. And for this we have to set one more option for the section or group where you have placed the sub-report. So right click on the Section or Group, and select "Section Expert" option from menu.

  4. In this Section Expert dialog box, select the target Group/Section from left hand side, where you have placed sub-report, and then in the "Common" tab on right side, set the checkbox "Suppress Blank Section" as marked true.

Now run the main report and you should not see that blank space caused by sub-report(s) having no data.

Tuesday, September 20, 2016

C# DataTable throwing ReadOnlyException - "Column X is read only."

While using typed DataSets you might encounter this exception.

    Column X is read only.

Its because the default value for ReadOnly property of DataColumn in Typed DataSets is True. You can set it False in the properties window, but this will take impact in all code segments wherever this DataTable is being used.

So selectively setting ReadOnly property to false is a better option if you need this in only some parts of the program. You can loop through all columns of the table and set its ReadOnly property to false:

 foreach (DataColumn column in table.Columns) 
    column.ReadOnly = false; 

Or you can set for single column at a time:

    table.Columns["MyColumnName"].ReadOnly = false;