失败System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
在 System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
在 SAPTableFactoryCtrl._CSAPTaFacTable.get_Cell(Int32 lRow, Object vaColumn)
在 Timer.ZLIFNR.test() 位置 D:\定时取数程序\Timer最新的\Timer\Class\Base\ZLIFNR.cs:行号 164
ifunc.Call();
SAPTableFactoryCtrl.Tables tables1 = (SAPTableFactoryCtrl.Tables)ifunc.Tables;
SAPTableFactoryCtrl.Table ENQ = (SAPTableFactoryCtrl.Table)tables1.get_Item("ITOT"); //ZMM18为RFC接口的Table返回名称
int n = ENQ.RowCount;
string LIFNR,NAME1,LAND1,ORT01,REGIO,SORTL,STRAS,ADRNR,MCOD1,MCOD2,MCOD3,ANRED,BBBNR,BBSNR,BUBKZ,ERDAT,ERNAM,KTOKK;
string KUNNR, TELF1, TELF2, TELFX, STCEG, STKZN, DUEFL, TAXBS, UPTIM;
// decimal
for (int i = 1; i <= n; i++)
{
strsql = "";
count = 0;
LIFNR = ENQ.get_Cell(i, "LIFNR").ToString();
NAME1 = ENQ.get_Cell(i, "NAME1").ToString().Trim();
LAND1 = ENQ.get_Cell(i, "LAND1").ToString().Trim();
ORT01 = ENQ.get_Cell(i, "ORT01").ToString();
REGIO = ENQ.get_Cell(i, "REGIO").ToString();
SORTL = ENQ.get_Cell(i, "SORTL").ToString();
STRAS = ENQ.get_Cell(i, "STRAS").ToString();
ADRNR = ENQ.get_Cell(i, "ADRNR").ToString();
MCOD1 = ENQ.get_Cell(i, "MCOD1").ToString();
MCOD2 = ENQ.get_Cell(i, "MCOD2").ToString();
MCOD3 = ENQ.get_Cell(i, "MCOD3").ToString();
ANRED = ENQ.get_Cell(i, "ANRED").ToString();
BBBNR = ENQ.get_Cell(i, "BBBNR").ToString();
BBSNR = ENQ.get_Cell(i, "BBSNR").ToString();
BUBKZ = ENQ.get_Cell(i, "BUBKZ").ToString();
ERDAT = ENQ.get_Cell(i, "ERDAT").ToString();
164:行: BUBKZ = ENQ.get_Cell(i, "BUBKZ").ToString();
怎么回事 ,手工运行没有问题, 多执行几次就出现这个问题怎么回事?
失败System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
在 System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
在 SAPFunctionsOCX.IFunction.Call()
在 Timer.ZMB51.test() 位置 D:\定时取数程序\Timer最新的\Timer\Class\Base\ZMB51.cs:行号 151
同时 报的这个错 ifunc.Call();这句