there were some typos in my above post... this is more clear:
everything below works as expected until #6 where I try to have the multi-select listbox display the selected items in an edit form.
1. form code --i'm populating the listbox with items from the 'jobs' table using a select statment
<td align="right" valign="top">*Community Jobs Available</td>
<td valign="middle" style="width: 323px"><asp:ListBox ID="choosejobs" runat="server" DataSourceID="SqlDataSource1"
DataTextField="job_title" DataValueField="job_id" SelectionMode="Multiple" ></asp:ListBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>"
SelectCommand="SELECT * FROM [jobs] WHERE ([job_location] = @job_location)">
<SelectParameters>
<asp

arameter DefaultValue="San Francisco" Name="job_location" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
2. form code rendered in browser:
<select size="4" name="choosejobs" multiple="multiple" id="choosejobs">
<option value="1">Teacher</option>
<option value="2">Nurse</option>
<option value="3">Fireman</option>
<option value="4">Waitress</option>
<option value="4">Doctor</option>
...
</select>
3. when submitted - i turn it into a comma delimted set of job_id's like this--> 2,5,6 and write to a db record for the user
4. exact same set up as #1 for up edit form
[the edit form is in a seperate location (only available to Admin and has some extra fields)]
5. select * from user_jobs -- get user's list of jobs
string userjobs = dbreader["userjobs"] --> which makes userjobs = "1,2,5"
turn into array of string values (this works fine - I have printed it to the screen and all values are coming out ok)
6. loop through that array to set selected
foreach (string j in userjobs)
{
choosejobs.Items.FindByValue[j].Selected = true;
}
7. error! "System.NullReferenceException: Object reference not set to an instance of an object."
i have tried this: choosejobs.Items.FindByValue("3").Selected = true;
and get the same error so I think I'm something wrong in calling the Items.FindByValue ??
i would appreciate any help please!