本文介绍了如何使用OleDbCommand从我的C#应用​​程序调用iSeries上的远程过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在iSeries上有一个名为TFARW的远程过程。在iSeries上,我可以通过SQL成功运行此远程过程(例如,CALL BPCSUSR / TFARW('TEST'))。但是,当我尝试从c#应用程序调用这个相同的远程进程时,它只是挂起。我知道iSeries连接字符串是正确的,因为我成功读取了DB2文件。下面是我用来运行远程过程的c#代码:

Hi,
I have a remote procedure called TFARW on an iSeries. On the iSeries I can successfully run this remote procedure via SQL ( eg. CALL BPCSUSR/TFARW ('TEST') ). However when I try to call this same remote procesure from a c# application , it just hangs. I know that the iSeries connection string is correct as I am successfully reading DB2 files. Below is the c# code I am using to run the remote procedure:

SQL="CALL BPCSUSR.TFARW('TEST')
OleDbConnection conn2 = new OleDbConnection(connectionString);
conn2.Close();
conn2.Open();

OleDbCommand cmd = new OleDbCommand(SQL, conn2);
cmd.CommandType = CommandType.StoredProcedure;

cmd.Prepare(); 

cmd.ExecuteNonQuery();
conn2.Close()



在调试中运行时,有什么方法可以确定应用程序的原因挂了吗?上面的代码有什么想法我做错了吗?



问候

Pat


When running in debug, is there any way I can determine why application is hanging ? Any ideas from the code above as to what I am doing wrong ?

regards
Pat

推荐答案


这篇关于如何使用OleDbCommand从我的C#应用​​程序调用iSeries上的远程过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 23:49