0

This is my first post here so please excuse me if I do something wrong.

My question is really simple but it's like I stand in front of a wall...i just try to filter the data of my DataTable that I have created in my DataSet. I use the DataSet to fill my .rdlc report, this works good.

But now I want to filter the data in the DataTable by the Date Column (in my SQL Express it is named Datum and a nchar(10) column, it's not the best idea and I should change it i know ;) ).

I found this thread and this very usefull site and created my samplecode in base of this two sites but the data isn't filtered. I think i could have forgot something...

Here is my code:

    private void Form1_Load(object sender, EventArgs e)
    {
        DataView dvDay = new DataView(this.dsStempelJoinsTests.dtJOIN);
        dvDay.RowFilter = "Datum = '12.03.2014'";
        this.dtJOINTableAdapter.Fill(this.dsStempelJoinsTests.dtJOIN);

        this.rvData.RefreshReport();
    }

The Data in my SQL Express is stored like this 31.02.2014. But my .rdlc report shows data from other dates.

Community
  • 1
  • 1
Alexander
  • 1
  • 4
  • I haven't used ADO.Net for a while but I guess you need to Fill the adapter view the view: this.dtJOINTableAdapter.Fill(dvDay); – user2900970 Mar 13 '14 at 08:36

1 Answers1

0

You can use Sort in your SQL Query here is an example how you can do this. e.g

SELECT * FROM Customers
ORDER BY Country ASC;
Aftab Ahmed
  • 1,727
  • 11
  • 15