A. NET Framework error occurs during execution of user-defined routines or aggregation:

Source: Internet
Author: User

Message 6522, level 16, status 1, process insertcurrency_string, row 0th
The. NET Framework error occurs when you execute a user-defined routine or aggregate "insertcurrency_string:
System. nullreferenceexception: object reference is not set to the instance of the object.
System. nullreferenceexception:
In sqlserverclrcallnet. getconfigapp.. ctor ()
In sqlserverclrcallnet. clrfunction. callsapfunupdatedatavb (string strfunname, listdictionary strargs, listdictionary strtableargs, listdictionary strrettabs, listdictionary & strresult)
In sqlserverclrcallnet. clrfunction. getresultsetstring (string SnO, string strsonum, string strlot, string strschedline, datetime dtupdatedata)
.

 

System. nullreferenceexception: object reference is not set to the instance of the object.

 

Cause:CodeThe data in config cannot be read.

Lfcfunction. CS

Getconfigapp getapp = New Getconfigapp ();
Try
{
Vbsap = New Vbsap ( Null , Getapp. applicationserver, getapp. Client, getapp. systemnumber. tostring ());
Bool Boolconn = vbsap. connecttosap (getapp. User, getapp. Password, getapp. Language );

 

Getconfigapp. CS

View code

Using System;
Using System. Collections. Generic;
Using System. text;

Namespace Sqlserverclrcallnet
{
Public Class Getconfigapp
{
Public String Applicationserver = system. configuration. configurationmanager. etettings [ " Applicationserver " ]. Tostring ();
Public String Client = system. configuration. configurationmanager. receivettings [ " Client " ]. Tostring ();
Public String Language = system. configuration. configurationmanager. appsettings [ " Language " ]. Tostring ();
Public String User = system. configuration. configurationmanager. receivettings [ " User " ]. Tostring ();
Public String Password = system. configuration. configurationmanager. appsettings [ " Password " ]. Tostring ();
Public Int Systemnumber = Int . Parse (system. configuration. configurationmanager. receivettings [ " Systemnumber " ]);

}
}

 

App. config

<? XML version = " 1.0 " Encoding = " UTF-8 " ?>
<Configuration>
<Deleetask>
<! -- SAP system IP -->
<! -- SAP system IP -->
<Add key = " Applicationserver " Value = " 192.168.00.00 " />

<! -- Sap client number 500 -->
<Add key = " Client " Value = " 500 " />
<! -- Sap login language -->
<Add key = " Language " Value =" ZH " />
<! -- User Account -->
<Add key = " User " Value = " Zrfc_user " />
<! -- User Password -->
<Add key =" Password " Value = " ERP. RFC " />
<! -- SAP system number -->
<Add key = " Systemnumber " Value = " 20 " />
<Add key = " Clientsettingsprovider. serviceuri " Value = "" />
</Appsettings>
</Configuration>

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.