Showing posts with label Problem & Solutions. Show all posts
Showing posts with label Problem & Solutions. Show all posts

Thursday, 22 September 2016

The 'microsoft.ace.oledb.12.0' provider is not registered on the local machine - Resolved

        In this post we are going to see the interesting issue like "The microsoft.ace.oledb.12.0" provider is not registered on the local machine , first let we understand why this issues are raising, then we go step by step process how to resolve this.

While working with the Microsoft Access Database , we may receive error like following






Why this error is raising , There are number of reasons why we get this error, when trying to connect access or xlsx file, The ACE provider is not installed on operating systems by default., so how we can resolve this error, we have to many steps , anything solution can resolve your issues. because by default this settings needed by application.




For web applications first we have to do the following steps.

Solution 1:

1. Open the run window , Type inetmgr and press Enter
2. Now IIS will be there, Next select the application pool, under which your application is running

















3. Go to the Advance settings, enable 32-bit application "True"







For Visual studio projects, we have to change the build

Solution 2:

1. Open your project in visual studio
2. Right click on the solution in solution explorer




3. Click on the Configuration manager 
4. Click on the Active Platform Drop down, if x86 is already there then select that, else click on New.





5. Select x86 as new target platform


6. Compile the Project




For Windows Applications
Solution 3:
you can do this settings in project level also,  by setting the target platform as X86 by using the following steps  
Select the project =>properties => Debug => Platform Target=> X86
(or)
Select the Project => Properties => Build => Platform Target => X86






Solution 4:

Step 1:
If above step doesn't work for you ,then  try below steps
Try to connect the access database from visual studio , if you get error then install the following thing



Step 2:
If above step doesn't work for you ,then  try below steps,

 Note: It will work for Office 2010, even though it is 2007 



Step 3:
Again if you have issues , try below steps
Install the following Office system drivers from following link


Step 4:


Install MS Office in the system



From the above steps you can  learn how to resolve the isssue "Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine"


Wednesday, 21 September 2016

Log4Net is not logging the file, randomly stops resolved

In this post we are going to see some important things in the Log4Net logging utility, normally Log4Net is using for logging the data in application, sometimes you may notice that the logging stops randomly, you know why it is happening, surely not, it stops with out any information for that kind of scenario, how we can find the root of the issue, Let me guide you how to do that 



<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="log4net.Internal.Debug" value="true"/>
    </appSettings>
</configuration>


From the above you may notice that we are adding one new key in the app setting which makes the Log4Net to run in Debug mode, this makes to write everything happening behind the scene to do that we have to configure the path to write the debug info.so use the below code snippet configuration



<configuration>
    ...
    <system.diagnostics>
        <trace autoflush="true">
            <listeners>
                <add 
                    name="textWriterTraceListener" 
                    type="System.Diagnostics.TextWriterTraceListener" 
                    initializeData="D:\logging\log4net.txt" />
            </listeners>
        </trace>
    </system.diagnostics>
    ...
</configuration>


From the above configuration we are writing the debug information in the location, please make sure that the path must be in write permissions

For web applications find the account under which it is running may be IIS_IUSRS, IIS_WPG, or under specific account,then now go to the folder path where you are writing log, do the following steps to give permission.


1. Select the folder, right click and click on properties
2. Select the security tab
3. Click on Edit , under users or group
4. Click Add on security
5. click Advance button
6. Click Find Now






\
















Now you will get a list of users find the users like IIS_IUSR, or IIS_WPG or specific account under you run ur application, and give OK. thats it



Sample configuration file for Log4Net with out Debug:


<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

<log4net debug="true">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
  <file value="C:\\log\\TLog.txt" />
  <appendToFile value="true" />
  <rollingStyle value="Size" />
  <maxSizeRollBackups value="10" />
  <maximumFileSize value="10MB" />
  <staticLogFileName value="true" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
  </layout>
</appender>

<root>
  <level value="DEBUG" />
  <appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>




After done this we have to load the information on startup or in load of application

protected void Application_Start(Object sender, EventArgs e) {
   log4net.Config.XmlConfigurator.Configure();
}



From this post you can learn how to debug the Log4Net loggig issue when it randomly stops.


Friday, 25 July 2014

Installing the Extension in Visual studio 2013 results in The Extension Manifest in Invalid [Resolved]

In this article we are going to see some problems and there solutions, for example you may had came across a error when installing a extension in Visual studio 2013 like "Extension Manifest is Invalid".




Why this error occur ?
  This is because in your system , you may have various versions of visual studio when double click the extension it target the wrong  version , i.e you may have visual studio 2013 in ur sysetm , later you are installing Visual studio 2010 for some purpose now this causes the porblem.

To solve this problem many of them will re install the visual studio 2013, then it will  work , to avoid this we can do this simple steps.

Steps:

1. Right click the extension and select Open with options.



2. In the above options select more Options to browse
3.Then scroll down to click the Look for another app in this PC to Browse 




4. Go to the Following Vs installation path 
   "{{installtion Drive}}\Program Files(x86)\Microsoft Visual studio 12.0\Common 7\IDE\VSIXinstaller.exe"        to browse for vsix installer.





5.After select this you can see the icon for the Extension will change as like this 


From this article you can solve some problem in the installation of extension in the visual studio 2013.

Unable to connect TFS with in VS2013 in windows 8.1 - Resolved

    In this article we are going to see some problem and it's solutions, sometimes you can notice that unable to connect TFS with in Visual studio 2013 in windows 8.1, But it will work in some other visual studio versions.

Error Message will be like this format :
Unable to connect to this Team Foundation Server http://{{server}}:8080/tfs

Why this error occur ? In depth you can see a another error message that specifies "key not valid to use in specified state when entering source control

To Avoid this error and connect the TFS successfully with visual studio follow the below steps.


Solution:

1. Close all instance of the Visual studio 2013.
2. Delete the following Key "TokenStorage" from RegEdit, to do that follow the below steps
3. press Windows + R
4. Type RegEdit in run window and enter.
5. Now Register Editor will launch.
6. Iterate to the following key in Regedit and Delete the Key
7. HKEY_CURRENT_USER\Software\Microsoft\VSCommon\12.0\ClientServices\TokenStorage


From this article you can solve problems related to TFS connect with visual studio.

Thursday, 20 February 2014

Transfer Domain name From one server to another server

Transfer Domain name from one server to another server
   
In this article going to see how to transfer domain name from one hosting server to another hosting server 
normally every user have many domain name for there website hosting in one server. sometime we need to change the hosting server due to some reasons , so we can do that in the following steps.



Example :

www.example.com 

above given domain name that will stored or located at some hosting like ( godaddy.com, hostgator.com, dreamhost.com, squarebrothers.com ,etc...........)

If you moving your Domain name from one hosting to another hosting

Example 

  hosting           Old                                New    hosting
godaddy.com  <--   www.example.com  --> squarebrothers.com

first we need know detail :  Current hosting NameServer  & New hosting NameServer
  all hosting have NameServer

Example :
server                      Old                                      New    server
cns1.godaddy.com  <---   www.example.com    --->   ns1.squarebrothers.com

go to your old hosting sever cpanel or setting go to www.example.com then
check for NameServer setting
       Then add custom NameServer of  New  hosting Nameserver.

it will take upto 72 hours to transfer to New Server

Then check whether your are Domain Name has transfer to New Server  or not by Click Here   

Otherwise use transfer domain in all hosting have but it have cost to transfer .


Sunday, 5 January 2014

Convert Xml in to CSV in c#


In this article we are going to see how to convert the xml in to CSV format, based on the custom delimiters.

Files:

Source code for Convert Xml in to CSV:

  class XmlToCsv
    {
        public enum RowDelimit
        {
            Default,
            NewLine,
            Space,
            Ambescent,
            Dollar
        }
        public enum ColumnDelimit
        {
            Default,
            Comma,
            TabSpace,
            Percentage,
            OrSymbol,
            Dot
        }
        public enum DataArrange
        {
            Element,
            Attribute
        }

        public static RowDelimit RowDelimiter { set; get; }

        public static ColumnDelimit ColumnDelimiter { set; get; }

        public static void FetchRowSeparater(RowDelimit delimit, out string separater)
        {
            switch (delimit)
            {
                case RowDelimit.NewLine:
                case RowDelimit.Default:
                    separater = Environment.NewLine;
                    break;
                case RowDelimit.Space:
                    separater = " ";
                    break;
                case RowDelimit.Dollar:
                    separater = "$";
                    break;
                case RowDelimit.Ambescent:
                    separater = "&";
                    break;
                default:
                    separater = Environment.NewLine;
                    break;
            }
        }


        public static void FetchColumnSeparater(ColumnDelimit delimit, out string separater)
        {
            switch (delimit)
            {
                case ColumnDelimit.Comma:
                case ColumnDelimit.Default:
                    separater = ",";
                    break;
                case ColumnDelimit.Dot:
                    separater = ".";
                    break;
                case ColumnDelimit.OrSymbol:
                    separater = "|";
                    break;
                case ColumnDelimit.Percentage:
                    separater = "%";
                    break;
                case ColumnDelimit.TabSpace:
                    separater = "\t";
                    break;
                default:
                    separater = ",";
                    break;
            }
        }

        public static void Convert(string xmlfilepath, string csvpath, string datatag, DataArrange arrange, RowDelimit rdelimit, ColumnDelimit cdelimit)
        {
            try
            {
                StringBuilder builder = new StringBuilder();

                XDocument doc = XDocument.Load(xmlfilepath);
                string Rowseparater = string.Empty;
                FetchRowSeparater(rdelimit, out Rowseparater);

                string Columnseparater = string.Empty;
                FetchColumnSeparater(cdelimit, out Columnseparater);

                foreach (XElement data in doc.Descendants(datatag))
                {
                    if (arrange == DataArrange.Element)
                    {
                        foreach (XElement innnerval in data.Elements())
                        {
                            builder.Append(innnerval.Value);
                            builder.Append(Columnseparater);
                        }
                    }
                    else
                    {
                        foreach (XAttribute innerval in data.Attributes())
                        {
                            builder.Append(innerval.Value);
                            builder.Append(Columnseparater);
                        }
                    }
                    builder.Append(Rowseparater);
                }

                File.AppendAllText(csvpath, builder.ToString());
            }
            catch
            {
                throw;
            }
        }
    }



Input Xml File:

<Employees>
<Employee name="Rajesh" address="Chennai" dept="IT" />
<Employee name="Suresh" address="Chennai" dept="CSE" />
<Employee name="Siva" address="US" dept="R&amp;D" />
</Employees>





Read the xml which have values in Attributes and convert that into CSV.

          try
            {
                XmlToCsv.Convert(@"D:\data\attrxml.xml", @"D:\data\rowxml.csv", "Employee", XmlToCsv.DataArrange.Attribute, XmlToCsv.RowDelimit.NewLine, XmlToCsv.ColumnDelimit.Comma);
                Console.Write("Done");
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
            }
            Console.Read();

Read the xml which have values in Elements and convert that into CSV.

Input Xml File:

<Employees>
<Employee>
    <name>Rajesh</name>
    <address>Chennai</address>
    <dept>IT</dept>
</Employee>
<Employee>
    <name>Suresh</name>
    <address>Chennai</address>
    <dept>CSE</dept>
</Employee>
<Employee>
    <name>Siva</name>
    <address>US</address>
    <dept>R&amp;D</dept>
</Employee>
</Employees>


            try
            {
                XmlToCsv.Convert(@"D:\data\elementxml.xml", @"D:\data\elemntxml.csv", "Employee", XmlToCsv.DataArrange.Element, XmlToCsv.RowDelimit.NewLine, XmlToCsv.ColumnDelimit.Comma);
                Console.Write("Done");
            }
            catch (Exception ex)
            {
                Console.Write(ex.Message);
            }
            Console.Read();


Output:

Rajesh,Chennai,IT,
Suresh,Chennai,CSE,
Siva,US,R&D,


You can change the delimiters based on your requirements.


From this post you can understand how to implement how to xml to csv format.