PC Review


Reply
Thread Tools Rate Thread

dataview.datasource not binding or updating datagrid

 
 
Ben
Guest
Posts: n/a
 
      29th Jul 2003
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
 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      30th Jul 2003
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" <(E-Mail Removed)> wrote in message
news:062101c3561c$c95aa5e0$(E-Mail Removed)...
> 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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to manage a datagrid with 2 dataview as possible datasource? =?Utf-8?B?UHVjY2E=?= Microsoft C# .NET 7 24th Jun 2007 04:51 AM
DataGrid.DataSource and binding Jo Siffert Microsoft Dot NET Framework Forms 1 19th Dec 2004 03:58 PM
Re: binding datagrid - dataview Miha Markic [MVP C#] Microsoft ADO .NET 0 25th Aug 2004 09:19 PM
Can a DataView be used without binding it to a DataSource Top Gun Microsoft C# .NET 2 11th Feb 2004 01:07 AM
Datagrid Datasource (Dataset , Dataview vs Datareader) Al Microsoft Dot NET 1 31st Dec 2003 12:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 PM.