title: SQLiteDataReader.read() empties results?
body: <p>I have a method in my C# class that calls a single result from an SQLite database. My database connection opens successfully, but after running breakpoints at different places, I noticed something odd. This is my code:</p>
  
  <pre><code>Dictionary&lt;string, string&gt; getResult(string id)
  {
      dataConn.Open();
      SQLiteCommand comm = dataConn.CreateCommand();
      comm.CommandText = "SELECT * FROM [tableName] WHERE id='" + id + "'";
      SQLiteDataReader result = comm.ExecuteReader();
      Dictionary&lt;string, string&gt; resultDict = new Dictionary&lt;string, string&gt;();
  
      /*
      This doesn't work.
      while(result.Read())
      {
          resultDict.Add(result.GetName(0), result.GetString(0));
      }
      */
  
      result.Read();
      for (int i = 0; i &lt; result.FieldCount; i++)
      {
          resultDict.Add(result.GetName(i), result.GetString(i));
      }
      result.Dispose();
      comm.Dispose();
      dataConn.Close();
      return resultDict;
  }
  </code></pre>
  
  <p>I know that I can use <code>SQLiteParameters</code> instead of inline concatenation, but for some reason they were breaking my query. </p>
  
  <p>In my first loop, if I place a breakpoint just before it starts, I can see that my query has returned a single result, exactly what I need. But, when I go into my loop, before I execute any code other than <code>reader.Read()</code>, VS2010 says "Enumeration yielded no results." but they were there moments before? </p>
  
  <p>So, I tried the second loop. Executing <code>reader.Read()</code>, and then looping through returned fields. When I do that, VS2010 throws the error "No current row selected.".</p>
  
  <p>I'm completely lost with this, I have no idea what's wrong, because the rest of my SQLite connections for other database files work fine. I've tested my query in <code>SQLite Administrator</code>, and my query executes perfectly fine. All I'm aiming for is to end up with a dictionary where the key is the name of the field, and the value is the result of said field. Any ideas on what's wrong? Or, is there a way I can make this code simpler, in the process of fixing it?</p>