473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 22 '05 #1
2 2467
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 22 '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 22 '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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
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...

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.