422,751 Members | 2,100 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,751 IT Pros & Developers. It's quick & easy.

Cannot interpret token

P: n/a
Hey

..NET 2.0

I have a DataTable I'm trying to do a select against... This is the
argument I pass into the Select method:
"date >= 01.12.2007 00:00:00 and date < 01.01.2008 00:00:00"

This argument throws an exception during runtime.. The exception is this:
Cannot interpret token '.' at position 14

any suggestions?
Jan 14 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 14 Січ, 11:47, "Jeff" <do...@spam.mewrote:
I have a DataTable I'm trying to do a select against... This is the
argument I pass into the Select method:
"date >= 01.12.2007 00:00:00 and date < 01.01.2008 00:00:00"

This argument throws an exception during runtime.. The exception is this:
Cannot interpret token '.' at position 14

any suggestions?
Look here for the valid syntax of select expressions:
http://msdn2.microsoft.com/en-us/lib...on(VS.71).aspx

Regards,
Mykola
http://marss.co.ua
Jan 14 '08 #2

P: n/a
Jeff wrote:
Hey

.NET 2.0

I have a DataTable I'm trying to do a select against... This is the
argument I pass into the Select method:
"date >= 01.12.2007 00:00:00 and date < 01.01.2008 00:00:00"

This argument throws an exception during runtime.. The exception is this:
Cannot interpret token '.' at position 14

any suggestions?

Not having used that syntax for querying a data table, I would assume it
would need to delimit the date/time value from the rest of the
expression, perhaps like this:

"date >= '01.12.2007 00:00:00' and date < '01.01.2008 00:00:00'"

--
Lasse Vgsther Karlsen
mailto:la***@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jan 14 '08 #3

P: n/a
Personally I really hate the whole idea of DataTable.Select - [snip]
I'd have stopped at the period ;-p
it should have been delegate based from the start, even aside from LINQ.
To be fair, the functional-programming stuff *mainly* kicked off in
2.0; however, I can't think of a sensible reason that it couldn't have
used tokenised parameters (ala SQL). I guess they just wanted single-
textbox filtering (etc) in the IDE.

I was going to cite IBindingListView.Filter as an example here, but
actually it looks like this interface is 2.0 (where-as
DataTable.Select and DataView.RowFilter are 1.x)... so even less of an
excuse...

Oh well...

Marc

Jan 14 '08 #4

P: n/a
On Jan 14, 12:44 pm, Marc Gravell <marc.grav...@gmail.comwrote:
Personally I really hate the whole idea of DataTable.Select - [snip]

I'd have stopped at the period ;-p
:)
it should have been delegate based from the start, even aside from LINQ.

To be fair, the functional-programming stuff *mainly* kicked off in
2.0; however, I can't think of a sensible reason that it couldn't have
used tokenised parameters (ala SQL). I guess they just wanted single-
textbox filtering (etc) in the IDE.
As an alternative to delegates, a simple interface would have
sufficed. To me, it's crazy to have a way of selecting data which
doesn't let you put your own code in.
I was going to cite IBindingListView.Filter as an example here, but
actually it looks like this interface is 2.0 (where-as
DataTable.Select and DataView.RowFilter are 1.x)... so even less of an
excuse...
:)

Jon
Jan 14 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.