小编Sto*_*orm的帖子

SAP和C#之间的通信

我只是一个初学者,我正在尝试理解SAP之间的通信,例如使用SAP连接器的C#应用​​程序.我搜索了很多网站,但我真的找不到我的问题的答案!我希望这里有人可以帮助我.

例如,我在SAP中有一个功能getProducts(String = " ").这个功能在SAP中完美运行,它不是由我编写的,我无法访问它,所以我不能给你任何代码(对不起).我必须使用C#应用程序与SAP通信.

我想要做的是给SAP一个参数,例如"Shirts".SAP将回馈所有衬衫.我不能这样做Function.GetValue()(或者至少我认为我不能),因为GetValue只需要整数.但如果我进入GetValue(0),它会给我所有的产品(这是正常的)而不仅仅是衬衫.

这是我用来获取数据的代码:

IRfcFunction function = fRepository.CreateFunction("GetProducts");
function.Invoke(destination);
String products = function.GetValue(0).ToString();
result = Functions.Instance.GetData(result);
Run Code Online (Sandbox Code Playgroud)

有没有办法给SAP函数一个字符串参数(而不是一个整数,在本例中为0)并检索我想要的数据?

c# sap

8
推荐指数
1
解决办法
6276
查看次数

即使有 30 GB 内存可用,也会出现内存不足异常

我有一个程序(x64)消耗大量内存。我正在运行win server 2008 R2 SP148 GB RAM(64 bit).net frame work 4.5.

我也在gcAllowVeryLargeObjects = trueapp.config中设置了。

当我运行该程序时,它消耗了 18 GB 内存,之后出现异常

EXCEPTION: System.OutOfMemoryException: Insufficient memory to continue the execution of the program.

   at System.Text.StringBuilder.ExpandByABlock(Int32 minBlockCharCount)
   at System.Text.StringBuilder.Append(Char* value, Int32 valueCount)
   at System.Text.StringBuilder.Append(String value)
   at System.Xml.XmlTextEncoder.Write(String text)
   at System.Xml.XmlTextWriter.WriteWhitespace(String ws)
   at System.Xml.XmlElement.WriteElementTo(XmlWriter writer, XmlElement e)
   at System.Xml.XmlNode.get_OuterXml()
   at System.Security.Cryptography.Xml.Utils.PreProcessElementInput(XmlElement e
   lem, XmlResolver xmlResolver, String baseUri)
   at System.Security.Cryptography.Xml.Reference.CalculateHashValue(XmlDocument
   document, CanonicalXmlNodeList refList)
   at System.Security.Cryptography.Xml.SignedXml.BuildDigestedReferences()
   at System.Security.Cryptography.Xml.SignedXml.ComputeSignature()
Run Code Online (Sandbox Code Playgroud)

它给出了“内存不足”,但我们仍然有 30 …

.net c# memory memory-management windows-server-2008

6
推荐指数
2
解决办法
4963
查看次数

取消选择c#中的列表框项

我在用c#编写的windows phone应用程序代码中使用列表框.

<Grid>
<ListBox x:Name ="gsecList" ItemsSource="{Binding}" SelectionChanged="ShowGsecDetails">
Run Code Online (Sandbox Code Playgroud)

事件处理程序:

private void ShowGsecDetails(object sender, SelectionChangedEventArgs e)
{
    string indexCode = gsecList.SelectedIndex.ToString();
    NavigationService.Navigate(new Uri("/contactDetail.xaml?type=gsec&index="+indexCode, UriKind.Relative));
}
Run Code Online (Sandbox Code Playgroud)

我使用eventhandler listBox1.SelectionChanged导航到其他页面,具体取决于用户所做的选择.现在当我再次导航回页面时,我看到listITem仍然被选中.我该如何取消选择该项目?我试着用listBox1.SelectedIndex = -1.但这似乎调用了selectionChanged事件处理程序.

c# wpf listbox windows-phone-7

3
推荐指数
2
解决办法
1万
查看次数