MichaelJamesJassi
New member
- Joined
- Mar 15, 2008
- Messages
- 2
- Programming Experience
- 1-3
Hi Experts,
I need help with a databinding in a text box, which draws a column from a dataview.
the sql statement used for the dataview is:
SELECT ArtistID, SUM(Popularity) from ArtistPopularity WHERE NOW >= PeriodStart AND NOW <= PeriodEnd GROUP BY ArtistID
The dataview is row filtered by artist id. The artist id can be selected through a combobox.
The crux of the issue is that not all artists will have a popularity, so this means there will be null values for some artists. So when you scroll through the artist id's in the combobox, only ones with popularities should come up in the dataview.
First i got an indexoutofrange exception, stating that there is no row at positiong 2, this is down to the fact that position 2 in the dataview does not have a value so i caught the exception like so:
Try
TextBox13.Text = oArtistPopularity3DT.Rows(TextBox1.Text).Item("Popularity")
Catch ex As Exception
End Try
But now the problem i face, is that the textbox does not update to the values inside of the datview now. It just remains the same as the last value, before it catches the index out of range.
How do i make it show the value in the textbox, when there is a value in the dataview.
Any help is much appreciated
thanks.
I need help with a databinding in a text box, which draws a column from a dataview.
the sql statement used for the dataview is:
SELECT ArtistID, SUM(Popularity) from ArtistPopularity WHERE NOW >= PeriodStart AND NOW <= PeriodEnd GROUP BY ArtistID
The dataview is row filtered by artist id. The artist id can be selected through a combobox.
The crux of the issue is that not all artists will have a popularity, so this means there will be null values for some artists. So when you scroll through the artist id's in the combobox, only ones with popularities should come up in the dataview.
First i got an indexoutofrange exception, stating that there is no row at positiong 2, this is down to the fact that position 2 in the dataview does not have a value so i caught the exception like so:
Try
TextBox13.Text = oArtistPopularity3DT.Rows(TextBox1.Text).Item("Popularity")
Catch ex As Exception
End Try
But now the problem i face, is that the textbox does not update to the values inside of the datview now. It just remains the same as the last value, before it catches the index out of range.
How do i make it show the value in the textbox, when there is a value in the dataview.
Any help is much appreciated
thanks.