|
-
Aug 19th, 2008, 08:01 AM
#1
Thread Starter
Lively Member
Why DataTable Select doesn't support A*D
I am not sure some one asked it before.
I see that the Select Method of DataTable only supports * before and/or behind the characters. If it is A*D, it exits with exception.
I want to know why it cannot support? Any mechanism to explain this?
-
Aug 19th, 2008, 08:06 AM
#2
Re: Why DataTable Select doesn't support A*D
If you're trying to use a wildcard, use %
A%D
-
Aug 19th, 2008, 08:29 AM
#3
Thread Starter
Lively Member
Re: Why DataTable Select doesn't support A*D
Sorry, A%D is also invalid, both in MSDN document and my testing.
http://msdn.microsoft.com/en-us/libr...on(VS.71).aspx
a line:
Wildcards are not allowed in the middle of a string. For example, 'te*xt' is not allowed.
-
Aug 19th, 2008, 08:34 AM
#4
Thread Starter
Lively Member
Re: Why DataTable Select doesn't support A*D
I actually can guest why it cannot support, because * and % also are operators. if we set column like A*D, API cannot know it is A multiplied by B or A wildcard B.
But Microsoft just throw an exception , not user friendly.
-
Aug 19th, 2008, 08:34 AM
#5
Re: Why DataTable Select doesn't support A*D
It's probably a limitation due to trying to keep the implementation as small as possible. But I'm sure there's a workaround....
-tg
-
Aug 19th, 2008, 09:47 PM
#6
Thread Starter
Lively Member
Re: Why DataTable Select doesn't support A*D
Hi, even it is not directly supported, I need to implement it myself.
For A*D, and I can just seperate A* and *D
but for free combination, like A*D*B*C*
How can we handle?
-
Aug 20th, 2008, 08:31 AM
#7
Re: Why DataTable Select doesn't support A*D
Don't use the .Select method of the DT..... how about using a DataView instead, and setting the filter property?
-tg
-
Aug 20th, 2008, 09:34 AM
#8
Thread Starter
Lively Member
Re: Why DataTable Select doesn't support A*D
I actually use DataView.filter.
But the problems are the same
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|