[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

filter function on dataset in vb.net 2005

Posted on 2008-02-12
3
Medium Priority
?
625 Views
Last Modified: 2013-11-26
Hi,

I have the following code: -

    Private Sub cmdShowReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdShowReport.Click
        Dim a As Integer
        Dim dv As DataView = ds2.Tables("Tests").DefaultView
        For a = 1 To 32

            Dim row As DataRow = DataSet1.Tables("Test_Report").NewRow

            dv.RowFilter = "TestID = " + a.ToString()
            If dv.Count > 0 Then
                MsgBox("Found")
                row("TestID") = ds2.Tables("Tests").Rows.Item(1).Item(1)
                row("Score") = ds2.Tables("Tests").Rows.Item(1).Item(0)
            Else
                row("TestID") = a
                row("Score") = "0"
            End If
            DataSet1.Tables("Test_Report").Rows.Add(row)
        Next

        DataGridView3.Refresh()
    End Sub

IT will filter and show 1 record using dv.RowFilter = "TestID = " + a.ToString()
But I am trying to find out how I set the dataset back to an unfiltered state please as before I placed the filter on it.

Hope this makes sense.

Lee
0
Comment
Question by:ljhodgett
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 2000 total points
ID: 20873568
Just set it empty:

dv.RowFilter = ""
0
 

Author Comment

by:ljhodgett
ID: 20873645
lol, Never thought of that.

The only issue I have now is how do I get the data from lets say the first row of the returned filter in the second column ie if it returns: -

1                     6

How do I retrieve the 6

Many Thanks
Lee
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 20873715
That should be:

        dv.Item(0).Item(1)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question