473,782 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can anybody tell how to filter the row having date as string to DateTime ?

27 New Member
hi all, i want to filter the date which is in label1.text
like
dview.RowFilter = "dir_bdate = '"+label1.Text+ " '" ;
here dir_bdate is my DateTime field of database and label1 contains string in DD/MM/YYYY formate so this is giving me an error like below



Error :System.Data.Ev aluateException : Cannot perform '=' operation on System.DateTime and System.String. at System.Data.Bin aryNode.SetType MismatchError(I nt32 op, Type left, Type right) at System.Data.Bin aryNode.Compare (Object vLeft, Object vRight, Type type, Int32 op) at System.Data.Bin aryNode.EvalBin aryOp(Int32 op, ExpressionNode left, ExpressionNode right, DataRow row, DataRowVersion version, Int32[] recordNos) at System.Data.Bin aryNode.Eval(Da taRow row, DataRowVersion version) at System.Data.Dat aFilter.Invoke( DataRow row, DataRowVersion version) at System.Data.Ind ex.AcceptRecord (Int32 record) at System.Data.Ind ex.InitRecords( ) at System.Data.Ind ex..ctor(DataTa ble table, Int32[] indexDesc, DataViewRowStat e recordStates, IFilter rowFilter) at System.Data.Dat aTable.GetIndex (Int32[] indexDesc, DataViewRowStat e recordStates, IFilter rowFilter) at System.Data.Dat aView.UpdateInd ex(Boolean force) at System.Data.Dat aView.SetIndex( String newSort, DataViewRowStat e newRowStates, DataFilter newRowFilter) at System.Data.Dat aView.set_RowFi lter(String value) at smail.BirthDate Report.PageInde x(Object sender, DataGridPageCha ngedEventArgs e) in c:\inetpub\wwwr oot\smail\birth datereport.aspx .cs:line 147



Please reply soon its very very urgent ?
Feb 15 '07 #1
0 1871

Sign in to post your reply or Sign up for a free account.

Similar topics

6
17924
by: Tony Miller | last post by:
All I have an aggregate query using the function Month & Year on a datereceived field ie: TheYear: Year() TheMonth: Month() These are the group by fields to give me a Count on another field by year & month When I try to place a date filter 'Between x And y ' on an expression field
3
35104
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
6
3298
by: Willie wjb | last post by:
Hi, i have a client program that sends a filter expression to the server PC. On that server PC this filter is put over a datatable and the result is send back. the server can be located on a PC with let's say ddmmyyyy windows date format and the client has mmddyyyy. when the filter expression send is "Date < #31/01/2003#", it will fail on
14
3690
by: Jon Davis | last post by:
I have put my users through so much crap with this bug it is an absolute shame. I have a product that reads/writes RSS 2.0 documents, among other things. The RSS 2.0 spec mandates an en-US style of date formatting (RFC 822). I have been using a variation of RFC 1123 (just change the time zone to an offset, i.e. "-0800"). It seems to be writing okay, but it's failing to parse. I've tried changing the regional & language settings in my...
2
8227
by: MajorTom | last post by:
Hello everybody I using an dataview rowfilter expression to filter some record from one dataset, is I only working with the date portion no problem, but how do I use the date and the time for filter some records ? the code that I have is like this one: crit1 = "fecha >= #"+dtpDesde.Value.ToString("MM/DD/YYYY")+"#"; crit2 = "fecha <= #"+dtpHasta.Value.ToString("MM/DD/YYYY")+"#"; filtro = crit1 + " AND " + crit2 ;
3
2191
by: Eddie901 | last post by:
I have a date field in a table formatted as a "Medium Date", e.g., 29-Mar-06. When I filter by that selection it's okay when the date is after the 13th of the month, but for the 12th or below it transposes the month with the day, so if I filter by 1-Feb-06, I get those records from 2-Jan-06. Anything I can do about this? Thanks for any help. Rachel Bourne
10
4789
by: Henrik Dahl | last post by:
Hello! I have an xml schema which has a date typed attribute. I have used xsd.exe to create a class library for XmlSerializer. The result of XmlSerializer.Serialize(...) should be passed as the value for the parameter of an SqlCommand for inserting the xml document in a column of a table where the column is typed to be of the same xml schema. This all sounds simple, but SQL Server REQUIRES the timezone to be specified for date values....
2
2111
by: AtCor | last post by:
SELECT Sheet1$. AS , CASE Sheet1$. WHEN 'CSPP100A2344' THEN '0' END AS Extension, SUBSTRING(Sheet1$., 1, 4) AS , SUBSTRING(Sheet1$., 5, 8) AS , SUBSTRING(Sheet1$., 1, 4) + '_' + SUBSTRING(Sheet1$., 5, 8) AS , Sheet1$. + '_' + SUBSTRING(Sheet1$., 1, 4) + '_' + SUBSTRING(Sheet1$., 5, 8) AS , Sheet1$. + Sheet1$.Surname AS , CASE Sheet1$.NOTES WHEN 'visit...
1
5638
by: Cara Murphy | last post by:
Hi There! Hoping you are able to help me with a filtering scenario: I have created a pop up form (Filter) to filter a report (Open Issues), which currently has a number of combo boxes which apply the filters to the fields in the report. I would like to use this form to filter the report within a date range (Raised Date From and Raised Date To), using unbound text boxes, without having to specify the criteria within the report's...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10311
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8967
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2874
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.