Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Bindingsource geting data from a closing form. Help pls
 

Bindingsource geting data from a closing form. Help pls

When im closing this form I get an error message becuase the ListBox1 is changing value to "" I guess when it closes and now the label is trying to get the value. How do I fix this?
Code Snippetippet
Private Sub ListBox1_SelectedIndexChanged_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
PhotoAlbum.ImageLocation = PhotoAlbumPath & "\" & ListBox1.SelectedValue & "\album.jpg"
PhotoAlbumTitel.Text = CType(AlbumBindingSource.Current, DataRowView).Item("Titel")
PhotoAlbumEdited.Text = CType(AlbumBindingSource.Current, DataRowView).Item("Edited")
PhotoAlbumPhotos.Text = CType(AlbumBindingSource.Current, DataRowView).Item("Photos") & "st"
End Sub
nyqa  Saturday, August 11, 2007 10:42 PM

Hi nuqa,

Could you tell us which error did you get when closing this form?

Thanks.

Rong-Chun Zhang  Tuesday, August 14, 2007 7:04 AM

Hi nyqa,

We are changing the issue type to “Comment�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

Thank you!

Rong-Chun Zhang  Friday, August 17, 2007 5:17 AM

You can use google to search for other answers

Custom Search

More Threads

• How Do I Set a Default Value for a DataGridView Column from Code (C#).
• Databound controls - deployment problem !!
• Generic BindingList copy constructor bug
• Data Adapter Error with DateTime
• Filling the GridView
• showing only date part of datetime in datagridview control.
• DataGridVieComboBoxCell value is not valid
• Lookup (Display/Value Mapping) implementation for dummies
• AVOID THE REPLACE FILE QUESTION
• DataBinding Enums and Images