//
myConnection.ConnectionString = "DSN=C2MEXT01;UID=GZAEXTUSR01;PWD=EXTUSR";
myCommand.Connection = myConnection;
}
private void button1_Click(object sender, EventArgs e)
{
try
{
myConnection.Open();
//
myCommand.CommandType = CommandType.StoredProcedure;
//myCommand.CommandText = "CALL C2MV5_SA.gva_odbc_PatientAdminData_O";
myCommand.CommandText = "{CALL C2MV5_SA.gva_odbc_PatientAdminData_O(?,?)}";
//
OdbcParameter param1 = new OdbcParameter();
param1.ParameterName = "ContactNr";
param1.OdbcType = OdbcType.VarChar;
param1.Size = 16;
param1.Direction = ParameterDirection.Input;
param1.Value = "9361429";
//
OdbcParameter param2 = new OdbcParameter();
param2.ParameterName = "PatName";
param2.OdbcType = OdbcType.VarChar;
param2.Size = 128;
param2.Direction = ParameterDirection.Output;
//
myCommand.Parameters.Add(param1);
myCommand.Parameters.Add(param2);
//
myCommand.ExecuteNonQuery();
//
textBox1.Text = param2.Value.ToString();
//
myConnection.Close();
}
catch (Exception e1)
{
MessageBox.Show("exception : " + e1.Message);
if (myConnection.State == ConnectionState.Open)
{
myConnection.Close();
}
}
}
}
SQLConnecte("C2MEXT01", "GZAEXTUSR01", "EXTUSR", "", "ODBC")
SQLExec("CALL C2MV5_SA.gva_odbc_PatientAdminData_O('9361429')","req1")
Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=20&topic_id=6170&post_id=24628