473,396 Members | 1,785 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,396 software developers and data experts.

rowfilter problem with fieldname containing space

Hi,
I've an error when using this expression
myDataview.rowfilter="client id = '1111'"

this is because the field name "client id" that contain a space.

I don't have the possibility to change the query (to add an alias for
example), what is the solution
Thanks.
Mar 15 '07 #1
3 3227
Try enclosing the field name in square brackets

myDataview.rowfilter="[client id] = '1111'"

hth
Rich
"touf" wrote:
Hi,
I've an error when using this expression
myDataview.rowfilter="client id = '1111'"

this is because the field name "client id" that contain a space.

I don't have the possibility to change the query (to add an alias for
example), what is the solution
Thanks.
Mar 15 '07 #2
Doen't work

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:6B**********************************@microsof t.com...
Try enclosing the field name in square brackets

myDataview.rowfilter="[client id] = '1111'"

hth
Rich
"touf" wrote:
>Hi,
I've an error when using this expression
myDataview.rowfilter="client id = '1111'"

this is because the field name "client id" that contain a space.

I don't have the possibility to change the query (to add an alias for
example), what is the solution
Thanks.

Mar 15 '07 #3
Your next trick would be to create an empty dataset in the Data Sources
window with no tables selected - all you want is an empty dataset and no
datasource - the default name will be DataSet1, then add a table in the
design view of this dataset with the same fields/columns as your original
table/query - except the fields/columns will not contains spaces in the
column Names -- then fill that table as follows:

Dim ds As New Dataset1 '--make sure you have created Dataset1 first
Dim dr1 As Datarow, i As Integer

For Each dr As Datarow In yourOriginalTable.Rows
dr1 = ds.yourCopyTable.NewRow '--this is the table you added to Dataset1
i = 0
For Each dc As DataColumn In yourOriginalTable.Columns
dr1(i)= dr(i)
i =+ 1
Next
ds.yourCopyTable.Rows.Add(dr1)
Next

--now the new copy table contains the same rows as the original table except
will good fieldnames. So set your dataview to this table and work off of
this table.
"touf" wrote:
Doen't work

"Rich" <Ri**@discussions.microsoft.comwrote in message
news:6B**********************************@microsof t.com...
Try enclosing the field name in square brackets

myDataview.rowfilter="[client id] = '1111'"

hth
Rich
"touf" wrote:
Hi,
I've an error when using this expression
myDataview.rowfilter="client id = '1111'"

this is because the field name "client id" that contain a space.

I don't have the possibility to change the query (to add an alias for
example), what is the solution
Thanks.


Mar 15 '07 #4

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

Similar topics

2
by: vbnetrookie | last post by:
In the dataview rowfilter property, how can I say that I just want Titles that start with 'A' to 'J' ?? ex: dv.rowfilter = " Country = ' France ' " I want dv.rowfilter = " Title = (from...
1
by: shiv | last post by:
Hi I have to RowFilter in a DataSet. My problem is My column Names use aliases So when i filter lets say Ds.defaultview.RowFilter="Region Name ='US'" does not work as it has a space in...
0
by: Paul Meller | last post by:
Hi, I am having a bit of trouble with a string used to filter a dataview in ASP.NET. Although the code I have works perfectly in almost all instances, there is a problem when using a string...
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 =...
7
by: Dan | last post by:
(Using Classic ASP & MS Access) I have a page that has 120 fields on it (mostly checkboxes). I cannot split this into smaller pages. So what i want to do is write a class that handles this. in...
8
by: Joe Cool | last post by:
I need to map several columns of data from one database to another where the data contains multiple spaces (once occurance of a variable number or spaces) that I need to replace with a single...
1
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
5
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.