Results 1 to 8 of 8

Thread: Why DataTable Select doesn't support A*D

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    110

    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?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Why DataTable Select doesn't support A*D

    If you're trying to use a wildcard, use %

    A%D

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    110

    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.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    110

    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.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    110

    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?

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    110

    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
  •  



Click Here to Expand Forum to Full Width