Here's some quick code that reproduces the error (on 64-bit Windows). The directory c:\test must exist.

System.Data.SQLite.SQLiteConnection SQLiteConn = new Pool Size=100;");
            System.Data.SQLite.SQLiteCommand cmd = SQLiteConn.CreateCommand();
            SQLiteConn.Open();
            IDataReader dr = null;
            string s;
            try
            {
                cmd.CommandText = "Create Table  test (Code String NOT NULL DEFAULT '')";
                cmd.ExecuteNonQuery();
                cmd.CommandText = "INSERT INTO TEST (Code) VALUES ('Test')";
                cmd.ExecuteNonQuery();
                cmd.CommandText = "INSERT INTO TEST (Code) VALUES ('174500')";
                cmd.ExecuteNonQuery();

                cmd.CommandText = "SELECT CODE FROM TEST";
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    s = dr.GetString(0); cast exception here on 2nd row
                    Console.WriteLine(s);
                }

            }
            finally
            {
                dr.Close();
                cmd.CommandText = "DROP table test";
                cmd.ExecuteNonQuery();
                cmd.Dispose();
                SQLiteConn.Close();
                SQLiteConn.Dispose();
            }