Advertisement

03.17.2008 at 04:01AM PDT, ID: 23246587
[x]
Attachment Details

RowFilter - filter rows between two dates

Asked by SamB in Visual Studio .NET 2005, .NET, Microsoft Visual Basic.Net

Tags: vb.net, Visual Studio 2005

Hi Experts,

I have a table that includes 'custID' and 'invDate' columns.

I would like to apply a rowfilter to this to show only the results for a certain custID where the invoices fall between a start and finsih date (selected by the user with DateTimePicker1 & DateTimePicker2)

I've attempted numerous variations on the code below but can't get it to work with dates. Any Ideals?

********************************************************
Dim dv As DataView = MasterDataSet1.Tables("Invoices").DefaultView

dv.RowFilter = "[custID]=" & Me.DmIDTextBox.Text & " AND [invDate] >=#"  & Me.DateTimePicker1.Text & "# AND [invDate] <=#" & me.DateTimPicker2.Text & "#"

Me.InvoiceBindingSource.DataSource = dv
********************************************************

I've tried with and without the '#', with Me.DateTimePicker1.Text and Me.DateTimePicker1.value Me.DateTimePicker1.value.date etc.... but can't get it to work.

Thanks in advance,

SamBStart Free Trial
 
Loading Advertisement...
 
[+][-]03.17.2008 at 04:19AM PDT, ID: 21141185

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2008 at 04:28AM PDT, ID: 21141223

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2008 at 06:36AM PDT, ID: 21141959

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.18.2008 at 03:33AM PDT, ID: 21149580

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.18.2008 at 07:45AM PDT, ID: 21151556

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, .NET, Microsoft Visual Basic.Net
Tags: vb.net, Visual Studio 2005
Sign Up Now!
Solution Provided By: ee_rlee
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628