Re: ADO.net ListView in C#
Check SelectedItems and SubItems if they contain something, because [0] means first element, which may not be presented (e.g. if the list is empty).
Re: ADO.net ListView in C#
Just to add to what boudino has said...you should run it through the debugger and inspect the contents of 'SelectedItems' and 'SubItems' at runtime. They may not be what you expect. If there is any chance those collections could be empty you should put a test around access to the values (e.g. using an 'if' statement...)
Re: ADO.net ListView in C#
Ok I'l go and check it out...
Re: ADO.net ListView in C#
why is it that every time I change the selected item in my listview using the SelectedIndexChanged event, it resets its value to nothing?