rowfilter problem with fieldname containing space

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Try enclosing the field name in square brackets

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

hth
Rich
 
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.
 
Doen't work

Rich said:
Try enclosing the field name in square brackets

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

hth
Rich


touf said:
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.
 
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 said:
Doen't work

Rich said:
Try enclosing the field name in square brackets

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

hth
Rich


touf said:
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.
 
Back
Top