473,473 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

RowFilter and DataColumn Named as Number

Hi All,

I have a column in my datatable that is named like a number i.e. 45

I know its not good to have a column named as number, but...

Anyways, so when i set the DataView's RowFilter to some thing like
"45='blah'"

System.Data.EvaluateException is raised with message "Cannot perform '='
operation on System.Int32 and System.String.".

Why is it taking a ColumnName as integer or am i missing something.

Lets say DataColumn was initialised somehting like this new DataColumn("45")

Anybody got any idea. I have tried "[45]='sadf'" and i currently cant change
the column name to some proper string.

<sorry for cross post>

Thanx in advance
rawCoder
Nov 17 '05 #1
2 1920
rawCoder,
Why is it taking a ColumnName as integer or am i missing something. Because 45 is an integer!

Consider:

"45=blah"

Where blah is also a column name. Are you comparing column 45 to column blah
or are you comparing the integer 45 to column blah? Hint the first operand
does not have to be a column name!
Anybody got any idea. I have tried "[45]='sadf'" and i currently cant
change
the column name to some proper string. Use [] to delimite the column name in your row filter itself.

Dim view As DataView
view.RowFilter = "[45]='blah'"

Works in VS.NET 2003 as expected

Hope this helps
Jay


"rawCoder" <ra******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Hi All,

I have a column in my datatable that is named like a number i.e. 45

I know its not good to have a column named as number, but...

Anyways, so when i set the DataView's RowFilter to some thing like
"45='blah'"

System.Data.EvaluateException is raised with message "Cannot perform '='
operation on System.Int32 and System.String.".

Why is it taking a ColumnName as integer or am i missing something.

Lets say DataColumn was initialised somehting like this new
DataColumn("45")

Anybody got any idea. I have tried "[45]='sadf'" and i currently cant
change
the column name to some proper string.

<sorry for cross post>

Thanx in advance
rawCoder

Nov 17 '05 #2
"[45]='blah'" did work, missed it due to my mistake when I tried it earlier.

Thanks
rawCoder
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:u0*************@TK2MSFTNGP10.phx.gbl...
rawCoder,
Why is it taking a ColumnName as integer or am i missing something. Because 45 is an integer!

Consider:

"45=blah"

Where blah is also a column name. Are you comparing column 45 to column

blah or are you comparing the integer 45 to column blah? Hint the first operand
does not have to be a column name!
Anybody got any idea. I have tried "[45]='sadf'" and i currently cant
change
the column name to some proper string.

Use [] to delimite the column name in your row filter itself.

Dim view As DataView
view.RowFilter = "[45]='blah'"

Works in VS.NET 2003 as expected

Hope this helps
Jay


"rawCoder" <ra******@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi All,

I have a column in my datatable that is named like a number i.e. 45

I know its not good to have a column named as number, but...

Anyways, so when i set the DataView's RowFilter to some thing like
"45='blah'"

System.Data.EvaluateException is raised with message "Cannot perform '='
operation on System.Int32 and System.String.".

Why is it taking a ColumnName as integer or am i missing something.

Lets say DataColumn was initialised somehting like this new
DataColumn("45")

Anybody got any idea. I have tried "[45]='sadf'" and i currently cant
change
the column name to some proper string.

<sorry for cross post>

Thanx in advance
rawCoder


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rawCoder | last post by:
Hi All, I have a column in my datatable that is named like a number i.e. 45 I know its not good to have a column named as number, but... Anyways, so when i set the DataView's RowFilter to...
2
by: Top Gun | last post by:
I am trying to code for a compound conditional in the DataView.RowFilter but don't quite no how to do the correct syntax for this. The following code sample chokes on dv.RowFilter: int batchid...
1
by: Rosario | last post by:
Hi at all, can I to apply a set of expressions at a rowfilter property of a dataview object? I would want to extract from a dataset a set of rows that satisfy more rowfilter expressions. Thanks!
1
by: Remy De almeida | last post by:
Hi, I am working on a test application to get databinding working. This is the code to bind the data. System.Data.DataRelation relCustOrd; System.Data.DataColumn colMaster1; ...
8
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter =...
1
by: Able | last post by:
Dear friends Do somebody see what is wrong with this?: myDataView.RowFilter = "fldDate Is Not Null And fldDate<" & System.DateTime.Today Regards Able
9
by: Marty McFly | last post by:
Greetings, I'm trying to let my users dynamically filter records from a table that relate to other tables. RELATIONSHIPS: . = . . = . There is a Many-to-Many relationship between...
8
by: KC | last post by:
For a DataView.Rowfilter can I use more than one expression? I want to filter out two different things. For example can I take: dv.RowFilter = "MTX <> 'Customer Forcast'" and ...
5
by: Gene Ariani | last post by:
Is there a limit to how big a rowfilter on dataview could be? my rowfilter is dynamically generated and if its get too big I get a stackoverflow error other wise it works fine. Any direction is...
1
by: Engineerik | last post by:
According to what I see in the manuals I should be able to use regular expressions with the rowfilter property of a dataview but I keep getting errors. Example: I want to find any rowview where...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.