By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 1,966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

dataview.datasource not binding or updating datagrid

P: n/a
Ben
Dim dv As DataView = New DataView
(DataSet11.Tables("InventoryTable"))

dv.RowFilter = "ItemAuthor LIKE '" &
ItemAuthor.Text & "%'"
dv.RowStateFilter =
DataViewRowState.ModifiedCurrent
dv.Sort = "ItemID"
Dim temp As Integer = dv.Count()
DataGrid1.DataSource = dv

DataGrid1.DataBind()
when i compile this code my dim temp integer is 2 meaning
that my select statement is getting data from the primary
table. When i go to fill this datagrid i still get 4
items which is what was contained before the dataview was
created. Any help would be great.. thank you.. Ben
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Ben
That code is putting a filter on the view where the ItemAutor in the table
is Like the textbox text AND the row state is Modified Current so are you
sure you have data that meets those requirements. If you just want the rows
to be filtered like the author then comment out the rowstate filter as i
guess this is your problem or at least change it to modified rows

Mark

"Ben" <bp****@altionet.com> wrote in message
news:06****************************@phx.gbl...
Dim dv As DataView = New DataView
(DataSet11.Tables("InventoryTable"))

dv.RowFilter = "ItemAuthor LIKE '" &
ItemAuthor.Text & "%'"
dv.RowStateFilter =
DataViewRowState.ModifiedCurrent
dv.Sort = "ItemID"
Dim temp As Integer = dv.Count()
DataGrid1.DataSource = dv

DataGrid1.DataBind()
when i compile this code my dim temp integer is 2 meaning
that my select statement is getting data from the primary
table. When i go to fill this datagrid i still get 4
items which is what was contained before the dataview was
created. Any help would be great.. thank you.. Ben

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.