title: How do I fix Error CS0165: "Use of unassigned local variable 'a'"?
body: <p>I want to create output from a CSV in Windows Forms </p>
  
  <pre><code> public struct Artikel
      {
          public String id;
          public double d;
          public double dmin;
          public double I;
          public double d2;
          public double e;
          public double I1;
          public double I2;
  
      }
  </code></pre>
  
  <p>Now I am declaring the Path</p>
  
  <pre><code> private void buttonEingabe_Click(object sender, EventArgs e)
      {
          var tabelle = Tabelle.getTabel(@"C:\Users\alexa\source\repos\metallBohrrer\metallBohrrer\db.csv");
          int index = 0;
          int anzahl = tabelle.Length;
          string temp = textBoxpk.Text;
          int tempint = 0;
  
          for (; index &lt; anzahl;)
          {
              if (temp == tabelle[index].id)
              {
                  tempint = index;
              }
  
              index++;
          }
  
          textBoxpk.Text = tabelle[tempint].id;
          //   textBox2.Text = tabelle[tempint].d;
          //   textBox3.Text = tabelle[tempint].dmin;
  
  
      }
  </code></pre>
  
  <p>After that I want to declare it and here I see the errors "CS0165 C# Use of unassigned local variable 'a'" and "CS0136 C# A local or parameter named cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter."</p>
  
  <pre><code>public static class Tabelle
      {
          public static Artikel[] getTabel(String Datei)
          {
              List&lt;Artikel&gt; artikel = new List&lt;Artikel&gt;();
              String[] zeilen = File.ReadAllLines(Datei);
              foreach (String zeilen in zeilen)
              {
                  String[] data = zeilen.Split(';');
                  Artikel a;
                  a.id = data[0];
  
                  artikel.Add(a);
  
              }
              return artikel.ToArray();
          }
      }
  </code></pre>
  
  <p>I really don't know why it won't build.</p>