Monday 30 November 2015

Tessnet2 Init-Method crashes with certain tessdata path

The problem is that if you have Tesseract installed there is an environment variable set ( TESSDATA_PREFIX )which contains the path of the tessdata. To use your own path it is necessary to uninstall Tesseract and delete the environment variable.

Wednesday 25 November 2015

Thursday 12 November 2015

Filter DataTable with column value C#



                   string expression;

                    expression = "ControlId = '" + ControlId + "'";

                    DataRow[] foundRows;

                    // Use the Select method to find all rows matching the filter.
                    foundRows = UploadedFiles.Select(expression);
                    if (foundRows.Length > 0)
                      {

                       }

Friday 6 November 2015

Sort DataTable C#



 public static DataTable resort(DataTable dt, string colName, string direction)
        {
            DataTable dtOut = null;
            dt.DefaultView.Sort = colName + " " + direction;
            dtOut = dt.DefaultView.ToTable();
            return dtOut;
        }



  controlsConfig = resort(controlsConfig, "FieldGroup", "ASC");

  public static DataTable Sortbyint(DataTable tdt, string colName, string direction)
        {
            DataTable Ndt = new DataTable();
            DataTable dt = tdt; // Assume this method returns the datatable from service    
            DataTable dt2 = dt.Clone();
            dt2.Columns["SortOrder"].DataType = Type.GetType("System.Int32");

            foreach (DataRow dr in dt.Rows)
            {
                dt2.ImportRow(dr);
            }
            dt2.AcceptChanges();
            DataView dv = dt2.DefaultView;
            dv.Sort = "SortOrder ASC";
            Ndt = dv.ToTable();
            return Ndt;
        }

  controlsConfig = Sortbyint(controlsConfig, "SortOrder", "ASC");

Wednesday 4 November 2015

File access is denied. You do not have the permission required to access the file C:\Outlook\Outlook.pst.

---------------------------
Personal Folders
---------------------------
File access is denied. You do not have the permission required to access the file C:\Outlook\Outlook.pst.
---------------------------
OK  

---------------------------

Solution:- 


1. Locate the pst file that is causing the issue
2. Right click and select Properties
3. Next to "Attributes", make sure "Read-only" is unchecked. 

This is often overlooked but will fix the problem in most cases

Monday 2 November 2015

Windows SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk.

solution:-

Disable SmartScreen Filter in Windows 


1. Open Control Panel and click on Action Center icon. Alternatively you can open it by typingAction Center at Start Screen and it'll show it in Settings section of search results page.
2. Now click on "Change Windows SmartScreen settings" link given in left sidebar.

3. It'll open SmartScreen settings window. Now you can select "Don't do anything (turn off Windows SmartScreen)" option and click on OK button.
Windows_8_Smart_Screen.png
4. That's it. It'll immediately turn off SmartScreen feature and you'll no longer get the warning message in Windows 8.
BONUS TIP:
You can also change SmartScreen filter settings using Registry Editor. Just follow these simple steps:
1. Type regedit in RUN or Start search box and press Enter. It'll open Registry Editor.
2. Now go to following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
3. In right-side pane, you'll find a string SmartScreenEnabled. Just change its value to any of following:
  • RequireAdmin (To require approval from an administrator before running downloaded unknown software)
  • Prompt (To give user a warning before running downloaded unknown software)
  • Off (To turn off SmartScreen)