title: Create dynamic variable name
body: <p>Can we create dynamic variable in C#?</p>
  
  <p>I know my below code is threw error and very poor coding. But this code have small logic like create dynamic variable </p>
  
  <pre><code>var name=0;
  for(i=0;i&lt;10;i++)// 10 means grid length
  {
      name+i=i;
  }
  
  var xx1=name1;
  var xx2=name2;
  var xx3=name3;
  </code></pre>
  
  <blockquote>
    <p>Is it possible in c#? Create dynamic variable in c#? and change the variable name in c#? and concatenate the variable name in c#(<em>like we can concatenate any control id or name</em>)...</p>
  </blockquote>
  
  <p><strong>Why I need the dynamic variable name (scenario):</strong></p>
  
  <pre><code>var variablename=""
  var variablename0=No;
  var variablename1=Yes;
  var variablename2=No;
  </code></pre>
  
  <p>.
  .
  .</p>
  
  <p>I have a <code>gridview</code> with multiple rows. And I need assign server side variable to every row. So I need set of variables in server side. the only I can set <code>Text=&lt;%# variablename+rowCount%&gt;</code> for every template field.</p>
  
  <p>This <code>rowCount</code> means every grid row index. </p>
  
  <p>If the grid has 2 rows, Then <code>rowCount</code> values are 0,1,2</p>
  
  <p>Now I need to change the <code>variablename</code> to <code>variablename0,variablename1,variablename2</code> dynamically for separate row. </p>