My bet is that you are pulling from char field and you might have some
whitespace padding in the value. Loop through the items in the list
and print out their values and the size for each one. You're getting
the error because you don't have an exact match.
On Fri, 29 Oct 2004 13:56:06 -0400, Falls, Travis D (HTSC, CASD)
<[EMAIL PROTECTED]> wrote:
>
> Hashtable items = getMenuItems(sender, e);
> dao.buildLogandDropDownView(items);
> raft_IDList.DataSource = dao.getRaftIDView();
> raft_IDList.DataTextField = "RaftID";
> raft_IDList.DataValueField = "RaftID";
> raft_IDList.DataBind();
> raft_IDList.Items.Insert(0, new ListItem("",""));
> Logger lg = new Logger();
>
> IEnumerator en = items.Values.GetEnumerator();
> while(en.MoveNext()){
> lg.writeLog("C://", "LOGS.txt","Value: " + en.Current.ToString());
> lg.writeLog("C://", "LOGS.txt","Value2: " + (String)items["jobid"]);
> lg.writeLog("C://", "LOGS.txt","Value3: " +
> raft_IDList.Items.FindByValue((String)items["jobid"]).Value);
> }
>
> my logger outputs
> Value: ICC1
>
> Value2: ICC1
> And blows up on the Value 3 with this Error:
>
> reference not set to an instance of an object.
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.NullReferenceException: Object reference not set
> to an instance of an object.
>
> Now the raft_IDList displays the ICC1 in its list so why can't I find it to
> make it selected?
>
>
>
> Travis D. Falls |Consultant, Raft.Net IT | 860.547.4070 |
> [EMAIL PROTECTED]
>
> -----Original Message-----
> From: Dean Fiala [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 28, 2004 4:38 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [AspNetAnyQuestionIsOk] DropDown List Control selected
>
> The problem is there is no item with a key value of "jobid".
>
> so this
>
> items["jobid"]
>
> returns no value
>
> you need to put in the actual jobid value as the key to get your
> selection out of the hashtable
>
> string jobid = "13"
> items[jobid]
>
> HTH
>
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
> Yahoo! Groups Links
>
> This communication, including attachments, is for the exclusive use of
> addressee and may contain proprietary, confidential or privileged
> information. If you are not the intended recipient, any use, copying,
> disclosure, dissemination or distribution is strictly prohibited. If
> you are not the intended recipient, please notify the sender
> immediately by return email and delete this communication and destroy all copies.
>
>
> Yahoo! Groups Links
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/