15,914,416 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11977135 (Top 7 by date)
Member 11977135
5-Mar-18 13:11pm
View
Since I know there is an API003, maybee it is the Connection string that points on wrong database ?
I use "Default Collection=MVX9MOD;". I used this with the .NET driver "using IBM.Data.DB2.iSeries;" where it is working, but maybee its different in "iSeries Access ODBC Driver" ?
Member 11977135
5-Mar-18 8:49am
View
Thankyou for your code update, but it results in same errormessage. And the API (Stored procedure) is only returning one fixed String, so I don't need a recordset. I also read the your link, but I can not find any useful info there.
Member 11977135
5-Mar-18 8:35am
View
This is working C# code:
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using IBM.Data.DB2.iSeries;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_Leave(object sender, EventArgs e)
{
string Connection = "";
bool isChecked = prod.Checked;
if (isChecked)
Connection = "DataSource=172.18.0.50; DefaultCollection=MVX9MOD; UserID=SKS6400; Password=password";
else
Connection = "DataSource=172.18.0.51; DefaultCollection=MVX9MOD; UserID=SKS6400; Password=password";
using (iDB2Connection i5conn = new iDB2Connection(Connection))
try
{
String tidskod = ("001SKA" + scannat.Text);
i5conn.Open();
iDB2Command ptQuery = new iDB2Command("API003", i5conn);
ptQuery.CommandType = CommandType.StoredProcedure;
ptQuery.Parameters.Add("@InFormat", iDB2DbType.iDB2Char);
ptQuery.Parameters["@InFormat"].Direction = ParameterDirection.Input;
ptQuery.Parameters["@InFormat"].Value = "0001";
ptQuery.Parameters.Add("@InData", iDB2DbType.iDB2Char);
ptQuery.Parameters["@InData"].Direction = ParameterDirection.Input;
ptQuery.Parameters["@InData"].Value = tidskod;
ptQuery.Parameters.Add("@OutFormat", iDB2DbType.iDB2Char);
ptQuery.Parameters["@OutFormat"].Direction = ParameterDirection.Input;
ptQuery.Parameters["@OutFormat"].Value = "0001";
ptQuery.Parameters.Add("@OutData", iDB2DbType.iDB2VarChar);
ptQuery.Parameters["@OutData"].Direction = ParameterDirection.Output;
ptQuery.Parameters["@OutData"].Value = "";
ptQuery.Parameters.Add("@ErrorData", iDB2DbType.iDB2VarChar);
ptQuery.Parameters["@ErrorData"].Direction = ParameterDirection.Output;
ptQuery.Parameters["@ErrorData"].Value = "";
ptQuery.ExecuteNonQuery();
String str = (string)(ptQuery.Parameters["@OutData"].Value);
stelle.Text = "";
stelle.Text = (str.Substring(2,10));
omrade.Text = (str.Substring(7,2));
plats.Text = (str.Substring(9));
errors.Text = (string)(ptQuery.Parameters["@ErrorData"].Value);
i5conn.Close();
i5conn.Open();
iDB2Command ptQuery2 = new iDB2Command("API005", i5conn);
ptQuery2.CommandType = CommandType.StoredProcedure;
ptQuery2.Parameters.Add("@InFormat", iDB2DbType.iDB2Char);
ptQuery2.Parameters["@InFormat"].Direction = ParameterDirection.Input;
ptQuery2.Parameters["@InFormat"].Value = "0001";
ptQuery2.Parameters.Add("@InData", iDB2DbType.iDB2Char);
ptQuery2.Parameters["@InData"].Direction = ParameterDirection.Input;
ptQuery2.Parameters["@InData"].Value = tidskod;
ptQuery2.Parameters.Add("@OutFormat", iDB2DbType.iDB2Char);
ptQuery2.Parameters["@OutFormat"].Direction = ParameterDirection.Input;
ptQuery2.Parameters["@OutFormat"].Value = "0001";
ptQuery2.Parameters.Add("@OutData", iDB2DbType.iDB2VarChar);
ptQuery2.Parameters["@OutData"].Direction = ParameterDirection.Output;
Member 11977135
2-Mar-18 16:43pm
View
Indeed there is. I made a program in C# calling the procedure. That is working fine.
Member 11977135
2-Mar-18 16:42pm
View
Deleted
Indeed there is. I made a program in C# calling the procedure. That is working fine.
Member 11977135
2-Mar-18 16:40pm
View
.Execute is the line
Member 11977135
2-Mar-18 16:39pm
View
Deleted
.Execute is the line
Show More