Groups | Blog | Home
all groups > vb.net data > november 2006 >

vb.net data : I'm not able to filter dataset with the dataset.tables.select


mike11d11
11/5/2006 7:38:14 PM
I cant seem to filter down my dataset table by criteria in expression.
Can someone tell me why I still have the same amount of rows after I
use this filter select option.



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Me.WorkListTableAdapter.Fill(Me.SQLDataSet.WorkList)

MsgBox(Me.AccuLogic_SQLDataSet.WorkList.Rows.Count)


End Sub



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click

Me.SQLDataSet.Tables("WorkList").Select("DSK = '999'", "DSK")

End Sub
mike11d11
11/5/2006 8:46:30 PM
Could I somehow take these rows and push them into another dataset
table or simply use this to filter out all other rows besides the ones
that meet this criteria?
Jay B. Harlow
11/5/2006 10:31:05 PM
Mike,
[quoted text, click to view]
Select is a function that returns a collection of rows that match the
criteria given.

http://msdn2.microsoft.com/en-us/library/det4aw50(VS.80).aspx

It is not a Sub that removes or filters rows in the table itself.


--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


[quoted text, click to view]
Jay B. Harlow
11/11/2006 10:41:01 AM
Mike,
Yes, however I normally limit the rows via a SELECT in my original SQL
statement.

When I do need to copy rows from one DataTable to another I normally use
DataTable.ImportRow on the destination:

http://msdn2.microsoft.com/en-us/library/system.data.datatable.importrow.aspx

Then its a simply for each on the source (the DataTable.Select)...

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


[quoted text, click to view]
AddThis Social Bookmark Button