473,395 Members | 1,379 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,395 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 21 '05 #1
2 2177
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 21 '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 21 '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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
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
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...

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.