title: Unhandled exception of type System.ArguementException while creating C# dictionary from SQL Table
body: <p>So I'm writing a console application that's made to grab info from an SQLServer table (photo urls) and then iterate, download, and save them. Right now I'm just trying to get it to grab the urls from the table and make a dictionary I can reference later. This is the code I have right now, and I keep getting an error that says "An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll" on line 36 (commented out) whenever I try and run it. </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Data;
  using System.Data.SqlClient;
  
  namespace PictureDownloader
  {
      class Program
      {
          static void Main()
          {
              Program nd = new Program();
              nd.getURLS();
          }
  
          public void getURLS()
          {
              SqlConnection sid = new SqlConnection("Connection String");
              sid.Open();
              Dictionary&lt;string, string&gt; photo = new Dictionary&lt;string, string&gt;();
              SqlCommand cmd = new SqlCommand("select lastname, photo from table_name where photo is not null", sid);
  
              SqlDataReader read = cmd.ExecuteReader();
              if (read.HasRows)
              {
                  while (read.Read())
                  {
                      //photo.Add(read["lastname"].ToString(), read["photo"].ToString());
                  }
              }
  
              foreach (KeyValuePair&lt;string,string&gt; dr in photo)
              {
                  Console.WriteLine(dr.Key.ToString() + " = " + dr.Value);
              }
              sid.Close();
          }
      }
  }
  </code></pre>
  
  <p>Any idea what I'm doing wrong? </p>