Never underestimate the power of Passion!

Showing posts with label Troubleshooting. Show all posts
Showing posts with label Troubleshooting. Show all posts

Wednesday, 22 March 2017

On 06:01 by Vardan Kumar in ,    13 comments

Unable to set the Freeze Panes property of Window Class C#

It is generally easy to resolve the compile time errors because the reason for the error is probably known but a run time error always hinders the development process for a considerable amount of time so are the exceptions that unknowingly show up from no where. That is why it is always advised to handle each and every exception your application might throw. The only way to be a master in handling exception is experience, yeah you read it right. More you develop, more problem you will encounter in your developing environment and in turn more you will know the reason and the so called timing of the exceptions.

Exception

One of the most encountered is "unable to set freeze panes property of window class"  which show up when you try to freeze panes while formatting an excel file in c#.

Reason

The main reason for occurrence of such an exception is incompatibility between older and the newer versions of MS Excel.

When it occirs

This exception occurs when you are using a newer version of MS Excel and your application gets activate in background, I repeat your MS Excel application thread opens in the minimized state which hinders the freezing pane process.

How to counter this exception?

Obviously to get a solution to a problem, first of all understanding the problem is must more precisely the reason of problem should be known. Since we know the reason why freeze panes property is not set and the exception is thrown we can provide a solution.

So if somehow we can make our MS Excel thread open in maximized state or normal state explicitly then bingo we successfully resolved the issue.

Still it is a good practice to surround the exception causing snippet with try block and catch the exception so that there is no exceptional flow change in your application.

Unable to Set Freeze Panes property of Windows Class in c#
Unable to Set Freeze Panes Exception


Let us look at the source code for the same


Source Code


//Maximize the window state before setting freeze panes property

ExcelApp.Application.ActiveWindow.WindowState = Microsoft.Office.Interop.Excel.XlWindowState.xlMinimized;
                 ExcelApp.Columns.AutoFit();
                    try
                    {
                        ExcelApp.Application.ActiveWindow.FreezePanes = false;
                        ExcelApp.Application.ActiveWindow.SplitColumn = 1; //To freeze first column
                        ExcelApp.Application.ActiveWindow.SplitRow = 1; // To freeze Top Row
                        ExcelApp.Application.ActiveWindow.FreezePanes = true;
                      }

                       catch(Exception ex)
                       {

                       }



Freeze Panes Exception

Tuesday, 28 February 2017

On 22:04 by Vardan Kumar in ,    5 comments

Troubleshooting Cisco VPN client

Before starting troubleshooting, Let us see what VPN is and what it requires to perform its intended function.
A VPN connection is the extension of a private network that includes links across shared or public networks, such as the Internet. VPN connections (VPNs) enable organizations to send data between two computers across the Internet in a manner that emulates the properties of a point-to-point private link.
During installation process, an error 0x8004a029: Couldn't install the network component", might have occurred.
Error 0x8004a029 means that the maximum number of filter devices for the system has been reached. Other similar software (3rd party firewalls, etc.) install filters. You can 
either attempt to remove other software that has installed a filter, or attempt to increase the following registry entry value to allow more filters to be installed.
A filter driver is a Microsoft Windows driver that extends or modifies the function of peripheral devices or supports a specialized device in the personal computer. It is a driver or program or module that is inserted into the existing driver stack to perform some specific function.
Hence in order to install VPN properly increase in maximum number of network filters is required.
Now let us see the steps to change the system’s registry value to increase the maximum number of filter so that VPN client could install filters in conjunction with its network component.
1.     Open Registry Editor.

Troubleshooting VPN Client 0x8004a029
Reg Edit

2.     Extend System tab.

Troubleshooting VPN Client 0x8004a029
System tab Regedit



3.     Extend CurrentControlSet tab.

Troubleshooting VPN Client 0x8004a029
Current Control Set Regedit




4.      Extend control tab.

Troubleshooting VPN Client 0x8004a029
Control Regedit


5.     Seek down and click on Network tab.

Troubleshooting VPN Client 0x8004a029
Network Tab Regedit


6.     Double tap MaxNumFIlters option present on the right side partition of the registry editor.

Troubleshooting VPN Client 0x8004a029
Network Filters


7.     Change Value data from 8(default value) to 14 and tap ok.

8.     Now restart your system and try re-installing VPN client.

Troubleshooting VPN Client 0x8004a029
Max Num Filters


Note: If you don't see MaxNumFilters name, you can create it with the Type being REG_DWORD as shown below.


Monday, 6 February 2017

On 01:22 by Vardan Kumar in ,    7 comments
ORA-12505 Error


There are a few things that can cause this problem, but before we get started,you need to be sure that you can connect to the database using SQL*Plus. SQL*Plus, it's a command-line tool for connecting to Oracle databases that has been a standard part of Oracle for a long time and it is included with Oracle XE.
When connecting to an Oracle database using database connectivity API, we don't connect to the DB directly. Instead, we connect to a TNS listener, which then connects you to the database. The error means that the listener was up and you could connect to it, but it couldn't connect you to the database because it doesn't know that that database is up. There are two reasons for this:
  • The DB has not been started up,
  • The DB has not registered with the listener, e.g. because the database was started before the listener. 
  • When the DB starts, it registers itself with a listener if it is already running. If the listener isn't running, the DB doesn't register itself, and if the listener starts, it doesn't go looking for databases that might register with it.
ORA-12505 means that the listener knows about that database, but the listener hasn't received an acknowledgement from the DB that it is up.


  1. Start oracle database.

Start oracle database
Start database









   2. Connect to system.


Connect System
Connect System


3.     

   3. Try out command “LSNRCTL STAT”;


Oracle Listner
Ora-Listener

  
44.  Execute command
Alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))' scope = both;

Alter local listener
Alter System Listener






       5. Execute command

Alter system register;

Alter System Register
Alter System Register


6  6.Execute command
Exit;

Exit
Exit

7.       
    7.Execute command
lsnrctl stat

lsnrctl stat
lsnrctl stat









Now you should probably be able to connect.