M
Migs
Hi,
I have a dataview named dvContacts, a drop down list named ddlContacts and a
data grid named dgContacts
The drop down list is bound to a dataset with all contact names and when i
click a name i want my grid to be populated with that specific contacts'
details.
I use the dataview to do the selection and populate the datagrid.
Now I got this working but it requires me to use my adaptor to refill my
dataset. Isn't there anyway I can avoid this additional trip to my server.
I thought a dataview is a static view of the data within a dataset???
This is the code that works but I don't understand why I must do an
adapter.fill command.
Private Sub ddlContacts_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ddlContacts.SelectedIndexChanged
'Set the dataview's filter
dvContacts.RowFilter = "ContactID=" & ddlContacts.SelectedItem.Value
SqlDataAdapterContacts.Fill(dsContacts1)
dgContacts.DataBind()
End Sub
I have a dataview named dvContacts, a drop down list named ddlContacts and a
data grid named dgContacts
The drop down list is bound to a dataset with all contact names and when i
click a name i want my grid to be populated with that specific contacts'
details.
I use the dataview to do the selection and populate the datagrid.
Now I got this working but it requires me to use my adaptor to refill my
dataset. Isn't there anyway I can avoid this additional trip to my server.
I thought a dataview is a static view of the data within a dataset???
This is the code that works but I don't understand why I must do an
adapter.fill command.
Private Sub ddlContacts_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ddlContacts.SelectedIndexChanged
'Set the dataview's filter
dvContacts.RowFilter = "ContactID=" & ddlContacts.SelectedItem.Value
SqlDataAdapterContacts.Fill(dsContacts1)
dgContacts.DataBind()
End Sub