供自己備忘。
private void button1_Click(object sender, EventArgs e)
{
string strConn ="Provider=MSDAORA;User ID=****;Data Source=****;PassWord=****;";
OleDbConnection conn = new OleDbConnection(strConn);
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = conn;
cmd.CommandText = "test";
cmd.Parameters.Clear();
cmd.Parameters.Add(new OleDbParameter("P_In",OleDbType.Char, 14,ParameterDirection.Input,false,0,0,string.Empty,DataRowVersion.Default,0));
cmd.Parameters["P_In"].Value = this.textBox1.Text;
cmd.Parameters.Add(new OleDbParameter("P_Out", OleDbType.Char, 34,ParameterDirection.InputOutput, false, 0, 0, string.Empty, DataRowVersion.Default, 0));
cmd.Parameters.Add(new OleDbParameter("P_Out2", OleDbType.Integer, 4,ParameterDirection.InputOutput, false, 0, 0, string.Empty, DataRowVersion.Default, 0));
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
cmd.ExecuteNonQuery();
Console.WriteLine("");
this.textBox3.Text = cmd.Parameters["P_Out"].Value.ToString();
this.textBox4.Text = cmd.Parameters["P_Out2"].Value.ToString();
}