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>