Rowfilter for Boolean column

  • Thread starter Thread starter Kejpa
  • Start date Start date
K

Kejpa

Hi,
How do you write a Rowfilter for a boolean column?
col1=true
col1='true'
col1= 1
col1= -1

Will all render an exception:
Column 'col1' does not belong to table Test.
Any thoughts?
TIA
Kejpa
 
It looks like that error has nothing to do with your row filter because what
the error says is I can't find a column named col1 in the table called test.

hth
Peter
 
Yeah, I know.
But the field is there.
In my catch clause I set the datagrid to the datatable instead of to the
filtered dataview

-snip
Try

rsDW.RowFilter = sFilter

grdTableData.DataSource = rsDW

Catch err As Exception

Console.WriteLine(err.Message)

grdTableData.DataSource = dtTable

End Try

-snip
Regards
Kejpa
 
Sorry....
You have to reset the DataGrid's DataSource property
DataGrid.DataSource = Nothing
DataGrid.DataSource = dwFilter

Solved it all

Anyway, thanks for your effort.
/Kejpa
 
Hi this works for me

<<<<<<code>>>>>>>>>

Dim cnLogin As New SqlConnection(connectionstring)
Dim ds As New DataSet()
Dim dv As DataView
cnLogin.Open()
Dim da As New SqlDataAdapter("Select * from tr042", cnLogin)
da.Fill(ds)
dv = New DataView(ds.Tables(0))
dv.RowFilter = " col1 = true"
DataGrid1.DataSource = dv
cnLogin.Close()
cnLogin.Dispose()

<<<<<<<code>>>>>>>>

hth Peter
 
Glad you found the answer greetz Peter


Kejpa said:
Sorry....
You have to reset the DataGrid's DataSource property
DataGrid.DataSource = Nothing
DataGrid.DataSource = dwFilter

Solved it all

Anyway, thanks for your effort.
/Kejpa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top