Wednesday, 2 April 2014

An unhandled exception of type 'SAP.Middleware.Connector.RfcCommunicationException' occurred in sapnco.dll

An unhandled exception of type 'SAP.Middleware.Connector.RfcCommunicationException' occurred in sapnco.dll

An unhandled exception of type 'SAP.Middleware.Connector.RfcCommunicationException' occurred in sapnco.dll
Additional information:
LOCATION    CPIC (TCP/IP) on local host with Unicode
ERROR       partner 'ipaddress' not reached

It shows the error you are getting just because of  you have entered wrong ip address in  sap connection with asp.net .
sometimes  we use web service to connect sap but sometimes just dll files at that time data you providing like ..
ip address , uname and password then you need to add correct information else you will get error  like that.

Unhandled Exception: System.TypeInitializationException: The type initializer for 'SAP.Middleware.Connector.RfcDestinationManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SAP.Middleware.Connect or.RfcConfigParameters' threw an exception.

Unhandled Exception: System.TypeInitializationException: The type initializer for 'SAP.Middleware.Connector.RfcDestinationManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SAP.Middleware.Connect or.RfcConfigParameters' threw an exception.
This  error comes when we have included sapnco and utills dll in  your  folder for sap connection with
asp.net in c# or vb.net.
so for that you do just one thing  put your exe file and dll files in same folder.
and run exe files it will works.definitely.because sapnco and utills dll are external dll
so you need to add in your folder so there will be connection between your exe file and dll files.
if you will try on your machine it won't give you error but when you deploy on another machine then you
can face this issue .so better to think before do anything.somewhere you will get answer to register
your  dll files in GAC but that will be different scenario.so , just add proper dll files and
in proper way sometimes it happens that connection you are trying is unreachable.
so , first of all just try to do connection and then  move ahead.

this was single error but   you can find another like..

Unhandled Exception: System.TypeInitializationException: The type initializer fo
r 'SAP.Middleware.Connector.RfcDestinationManager' threw an exception. ---> Syst
em.TypeInitializationException: The type initializer for 'SAP.Middleware.Connect
or.RfcConfigParameters' threw an exception. ---> System.IO.FileLoadException: Co
uld not load file or assembly 'sapnco_utils, Version=3.0.0.42, Culture=neutral,
PublicKeyToken=50436dca5c7f7d23' or one of its dependencies. The application has
 failed to start because its side-by-side configuration is incorrect. Please see
 the application event log for more detail. (Exception from HRESULT: 0x800736B1)


File name: 'sapnco_utils, Version=3.0.0.42, Culture=neutral, PublicKeyToken=5043
6dca5c7f7d23' ---> System.Runtime.InteropServices.COMException (0x800736B1): The
 application has failed to start because its side-by-side configuration is incor
rect. Please see the application event log for more detail. (Exception from HRES
ULT: 0x800736B1)
   at SAP.Middleware.Connector.RfcConfigParameters..cctor()


   --- End of inner exception stack trace ---
   at SAP.Middleware.Connector.RfcConfigParameters.Initialize()
   --- End of inner exception stack trace ---
   at SAP.Middleware.Connector.RfcDestinationManager.RegisterDestinationConfigur
ation(IDestinationConfiguration config)
   at RecruitmentSchedular.MainFunction.Main(String[] args)

How to solve Problem Event Name:CLR20r3 | Asp.net console application

How to solve Problem Event Name:CLR20r3 | Asp.net console application
Problem Event Name:    CLR20r3
this exception comes if you have missed something or forgot to in include in your folder .
like if you are working with sql server  then  you forgot to add stored procedure.
and when you have used console or window application to generate .exe file and uploaded on another computer
or another server.
so for that no need to worry about that just  check whatever files and functions you have uploade on your
 local machine and same thing you should include when you are
running your  exe file on another machine.but before that you need to know your exe file is working proper.

Wednesday, 26 February 2014

How to find out day and year and month in respective date in sql server .2005 | sql server 2008.

How to find out day and year and month in respective date in sql server .2005 | sql server 2008.

we will see how can we find out day and month and year in given date separately .
to find out same we have to use DAY ,MONTH and YEAR keyword respectively which is by default or defined by sql server .
so no need to put some extra efforts.
just write same keyword after you use that keyword they will appear in pink colour in sql server.
lets look at examples.
suppose i have last date of submission my fee now i want to find  out day and month and year of lastdateofsubmission then i will
write like this.

for  day select DAY(LastSubmissionDate) from tableName
for month select MONTH(LastSubmissionDate) from tableName
for year  select Year(LastSubmissionDate) from tableName


now output will be
31 --day
2  --month
2014 --year


we can write in same line also..
select   DAY((LastSubmissionDate) ),MONTH ((LastSubmissionDate) ),YEAR ((LastSubmissionDate)  ) from tableNamewhere DueDate <> '' and DAY((LastSubmissionDate) ) in ('1','13','30')
which will gives you date which comes under day 1 , 13, 30 in every month and year.

Wednesday, 30 October 2013

How to find largest number in c | largest number examples.

How to find largest number in c | largest number examples.
Find largest number in c language without using  any loop with examples.


int maxnumber(int num1, int num2, int num3)
{
    int largestnumber;
        largestnumber=int num1; /*  Assume number 1 is largest number*/
        if (num2 > largestumber)
        {
            largetnumber=num2;   /* number 2 is largest number*/

        }
if (num3 > largestnumber)
{
largestnumber=num3;

}

return largestnumber;
}


we can do this by using for loop but here i have shown how to find out largest number using

if statement.