473,545 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
+ 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.Eva luateException 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 2482
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******@hotma il.com> wrote in message
news:%2******** ********@tk2msf tngp13.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.Eva luateException 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******** *****@TK2MSFTNG P10.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******@hotma il.com> wrote in message
news:%2******** ********@tk2msf tngp13.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.Eva luateException 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
304
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 some thing like "45='blah'" System.Data.EvaluateException is raised with message "Cannot perform '='
2
3949
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 = 123456; int segment = 3; DataView dv = new DataView(ds.taxBatch); dv.RowFilter = "BatchID = " + batchid + " && Segment = " + segment;
1
1535
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
8656
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; System.Data.DataColumn colDetail1;
8
3874
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 = "'Record ID' = '0'"; theView.RowStateFilter = DataViewRowState.ModifiedCurrent; Debug.WriteLine(string.Format("RowFilter = {0}",...
1
1834
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
5873
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 CustomersTable and
8
4770
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 dv.RowFilter = "MTX <> 'Actual vs. Forcast'"
5
4899
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 appreciated it.
1
9132
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 column APCode is not a string of exactly 3 uppercase letters. Assume dtBAirpt is an instance of a datatable having a column APCode Code snippet Try...
0
7465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7398
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5969
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5325
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.