If conn.State = ConnectionState.Open ThenĬongratulations on figuring out a fix. 'If something went sideways, make sure that you close the connection 'Add the ListViewSubItem to the ListViewItem 'subItem1.Text = reader.Item("colLastRun").ToString 'Ideally, I'd like to add "colLastRun as another sub item SubItem.Text = reader.Item("colNextRun").ToString 'to be shown in the second (and so forth) columnĭim subItem As New ListViewItem.ListViewSubItem 'Decare a new ListViewSubItem, and provide the information 'Declare a new ListViewItem, and provide the informationĭim item As New ListViewItem(reader.Item("colName").ToString) 'Check to see if the SELECT query returned any rows Reader = com.ExecuteReader(CommandBehavior.CloseConnection) 'Create a new instance of the command and provide the SELECT query, and the opened connectionĬom = New ("SELECT * FROM Schedules", conn) Here is the code I have, which sucessfully populates an item and one subitem: Dim conn As New (connectionString)ĭim com As ĭim reader As But I'm having trouble defining the other 4 subitems of each item.Īs you know, typically you define subitems with ListView1.Items(0).SubItems(1).Text = "Test Item 2"īut I can't figure out how to do that when working with an instance of a Listview which populates my Control Listview at runtime. I can correctly populate the Item and one subitem with no issue. I have a goal of populating a listview from the output data of a OleDb query.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |