title: How to write stored procedure using StringBuilder?
body: <p>I have written following code using string builder. </p>
  
  <pre><code>StringBuilder query = new StringBuilder("select distinct tc.bracode as [Branch Code] ,tc.braname as [Branch Name], tc.collname as [College Name],tu.uniname as University from tblcollegelist tc inner join tbluniversity tu on tc.uniid=tu.uniid where ( ");
  
  for (int i = 0; i &lt; uni.Count; i++)
  {
      query.Append("tu.uniname='" + uni[i] + "'");
  
      if (i &lt; uni.Count - 1)
      {
          query.Append(" or ");
      }
  }
  
  query.Append(" ) ");
  query.Append(" and ");
  query.Append(" ( ");
  
  for (int i = 0; i &lt; branch.Count; i++)
  {
      query.Append("tc.braname='" + branch[i] + "'");
  
      if (i &lt; branch.Count - 1)
      {
         query.Append(" or ");
      }
  }
  
  query.Append(" ) ");
  query.Append("group by tc.bracode ,tc.braname , tc.collname,tu.uniname");
  
  string sqlquery = query.ToString();
  
  cmd = new SqlCommand(sqlquery, con);
  
  dr = cmd.ExecuteReader();
  
  dt.Load(dr);
  
  dataGridView1.DataSource = dt;
  </code></pre>
  
  <p>can we pass multiple values to stored procedure using a parameter in C#?
  ex:- select * from table where country in ('India' 'USA' 'UK')</p>
  
  <p>here country has three values, how can I pass these three values to store procedure?  </p>