Hi James, here is the ADO code. The Stored Procedure is just a Cobol pgm that just Opens a Cursor. It then returns a RecordSet that Fills the DataGrid. It works fine in VB but this is the 1st time I am trying it in C# & .NET.
private void btnSearch_Click(object sender, System.EventArgs e)
{
string connString = ("Provider=IBMDADB2.1;" +
"Password=xxxxxxxx;" +
"User ID=xxxxxxxx;" +
"Data Source=DB2DSN;" +
"Mode=Read;" +
"Extended Properties=;" + "CURRENTFUNCTIONPATH=DVVV,SYSIBM,SYSPROC,SYSFUN;"

;
//Create the Connection Object passing the connection string to the constructor
OleDbConnection objConnect = new OleDbConnection(connString);
//Open the connection to the database
objConnect.Open();
//This is the name of the Stored Procedure to run.
string SQL = "STOREDPROCNAME";
OleDbDataAdapter objDataAdapter = new OleDbDataAdapter(SQL, connString);
objDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
//Instantiate a new OleDBParameter object. Passes 3 arguments
//1. “Stored Procedure variable name”
//2. OleDBType (i.e. Char, int, varchar, etc)
//3. Size
//Input parameter - Number
OleDbParameter param = new OleDbParameter("@NBR", OleDbType.Char, 6);
param.Value = strNbr;
param.Direction = ParameterDirection.Input;
objDataAdapter.SelectCommand.Parameters.Add(param);
// dsXX1 is an XML file to receive the RecordSet Results into the DataGrid
dsXX1.Clear();
objDataAdapter.Fill(dsBV1); //Abends here IConvertible error
DataGrid1.DataBind();
//Close the Connection. This is not handled through Garbage Collection.
objConnect.Close();
}