473,320 Members | 1,845 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,320 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 2462
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.