DataTable.Select question

  • Thread starter Thread starter Roy
  • Start date Start date
R

Roy

I have a DataTable with a column named "MyColumn (Something)". When I use the
following code to select the column with a value of "abc"

string filter = "MyColumn (Something)" + "=abc";
MyDataTable.Select(filter)

It shows an error:
"The expression contains undefined function call MyColumn().".

How do I let the Select() function know the "MyColumn (Something)" is the
title of the column, not a function?
 
Roy,

Is the columname MyColumn(Something)

or is it

MyColumn indexed by something.

This question is never made in the Select, therefore you stated that your
columname is MyColumn(Something)

Did you really made in your database a column with that name?

Cor
 
Try enclosing the colum name in square brackets "[MyColumn (Something)]"
that could work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top