DataTable.Select problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alex Markov

    #1

    DataTable.Select problem

    When I read table from Excel to DataTable object and one
    of the field's names is with "?" (for example "class?")at
    the end Select function throws the folowing exception:

    "...
    An unhandled exception of
    type 'System.Data.Sy ntaxErrorExcept ion' occurred in
    system.data.dll

    Additional information: Cannot interpret token '?' at
    position 6.
    ....."


  • Carl Fenley

    #2
    Re: DataTable.Selec t problem

    Well, you'll need something like the QuotePrefix and QuoteSuffix properties
    of the CommandBuilder. I think you need brackets ([]) around your suspect
    column heading names.

    - carl

    "Alex Markov" <markov@bgumail .bgu.ac.il> wrote in message
    news:2f7701c373 d7$499c78a0$a60 1280a@phx.gbl.. .[color=blue]
    > When I read table from Excel to DataTable object and one
    > of the field's names is with "?" (for example "class?")at
    > the end Select function throws the folowing exception:
    >
    > "...
    > An unhandled exception of
    > type 'System.Data.Sy ntaxErrorExcept ion' occurred in
    > system.data.dll
    >
    > Additional information: Cannot interpret token '?' at
    > position 6.
    > ...."
    >
    >[/color]


    Comment

    Working...