Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:
C#
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()

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
Posted
v2
Comments
I guess your SQL is wrong. It should only have the Procedure Name.
PClarkeirl 14-Jun-14 9:26am    
I changed the code to SQL = BPCSUSR.TFARW('TEST') - Same result
I also tried SQL= BPCSUSR.TFARW and passed the parameter in via oleDbParameter - Same result

1 solution

I have found the problem. My C# code was correct however the iSeries stored procedure was crashing which accounted for the C# application hanging. Once I fixed the source of the problem on the stored procedure then the call worked.

thanks to all who contributed

regards
Pat
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900