<p>i'm a long-time newbie to c#, and this question may be too obvious, so please forgive if i'm "doing it wrong."</p>

<p>Using Visual Studio 2005 Pro, C#, SQL Server 2000 EE SP3.</p>

<p>I have a stored proc that takes one input param and returns several output params pertaining to that input. I am also calling it successfully, and String.Format-ing the outputs into a RichTextBox. I'd like to call this proc periodically and each time stick the output params into a DataGridView row, so the results accumulate over time.</p>

<ul>
<li>What's the simplest/most elegant way to do get those parameters into the DataGridView? I'd prefer code instead of some GUI builder solution.</li>
<li>Am i overlooking some better approach, such as a more appropriate control?</li>
</ul>

<p>Thanks!</p>

```
```
//set up the datatable
DataTable dt = new DataTable("parms");
dt.Columns.Add("ParmName",typeof(string));
dt.Columns.Add("ParmValue",typeof(string));
//bind to a gui object
myDataGridView.DataSource = dt;

//do this after each sproc call
foreach (SqlParameter parm in cmd.Parameters)
{
    if (parm.Direction == ParameterDirection.Output)
    {
        //do something with parm.Value
        dt.Rows.Add(new object [] { parm.ParameterName, 
            Convert.ToString(parm.Value) } );
    }
}
```
```