Question: when i try to query database to retrive activity for selected crew, i give "Loca Sequence Error"

this is the code:

```
private Lst_active as new entityset(of Activity)   
private crw_list as new entityset(of Crew)

checklistbox.Items.addrange(Dbase.Crew)

```

then i choose from all crew in checklistbox and selected crews insert into entityset of Crew for further use.

```
crw_list.addrange(Checkedlistbox.checkeditems)

Lst_active.AddRange(From x In DBase.Stored_Activities Join z In crw_list On x.EMP_NO  Equals z.EMP_NO
                    Select x)

```

is there any way around? or im doing it wrong?

Answer: 
As Ivan pointed out, your `return` value does not match what you're assigning it to:

```
my %names = getNames(\@info);

sub getNames {
    ...
    return \%names;
}

```

`%names` excepts an even number of elements because it's a hash, but you're assigning it a reference to a hash, which is a single element. Hence the error.

This line of your subroutine is also a little suspect: `$names{@$item[0]}=@$item[1];`. Perhaps you meant to use `$names{$item->[0]}=$item->[1];`?

If you're trying to translate the array of arrays into a hash with keys pointing at the remaining values, you can use the following:

```
my @info=(
      ['k1','v1',1,2],
      ['k2','v2',2,3],
    );

my %names = map {$_->[0] => [@{$_}[1..$#$_]]} @info;

use Data::Dump;
dd \%names;

```

Outputs:

```
{ k1 => ["v1", 1, 2], k2 => ["v2", 2, 3] }

```

If however, you're just wanting the first "value", then the following would be sufficient:

```
my %names = map {$_->[0] => $_->[1]} @info;

```
The problem is that you're trying to assign hash reference to hash `my %names=getNames(\@info);`. Change it to work with reference:

```
my $names = getNames(\@info);

```

Or return hash:

```
return %names;

```