title: C# chart control populate with stored procedure with parameters
body: <p><a href="http://i.stack.imgur.com/CKrFb.jpg" rel="nofollow">enter image description here</a>I can populate chart control in C# Winforms with stored procedures without parameters and that's fine. But now I need to use stored procedure with parameters. Any advice how to do that?</p>
  
  <p>Below is my code how i am populating chart control with stored procedure without parameters.</p>
  
  <pre><code>sqlCon.Open();
  
  SqlCommand cmd = new SqlCommand();
  cmd.Connection = sqlCon;
  cmd.CommandType = CommandType.StoredProcedure;
  
  SqlDataAdapter myCommand = new SqlDataAdapter("[Proc1]", sqlCon);
  
  DataSet ds = new DataSet();
  myCommand.Fill(ds);
  
  DataView source = new DataView(ds.Tables[0]);
  chart1.DataSource = source;
  chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1;
  chart1.Series[0].XValueMember = "Pojazd";
  chart1.Series[0].YValueMembers = "Suma";
  
  chart1.DataBind();
  </code></pre>
  
  <p>Please help me :-)</p>