Problem with Rowfilter of Dataview

C

Catullus

Hi everyone,
I'm a n00b on VB.net programming and now I stumbled upon a problem I
can't solve, even after browsing the net for hours..

I have a dataview witg 4 columns; 2 string columns and 2 integer
columns
I want to use the RowFilter to get the 'records' where one of the
integer columns holds a certain integer and use that dataview as
datasource for my listbox
This gives all sorts of error...
I get errors like option strict on disallows implicit
coversion from string to double

Isn't it possible to use integers in a rowfilter?
I can do it otherwise by looping through the dataview and where-ever
the value in the specific column matches my parameter, I can add an
Item to the listbox?
But even here I have a question; Is it possible to add besides a
displaymember also a value that isn't shown but can be called by
"SelectedValue"?

I really hope you guys can help me!!

Here's the code from my dataview and filter

dvaanw2.RowFilter = "activiteitID =
" + paramactid
lstActAanwezigen.DataSource = dvaanw2
lstActAanwezigen.DisplayMember = "LidNaam"
lstActAanwezigen.ValueMember =
"usrID"

ps My Apologies for any mistakes against the english language, but I'm
from Belgium :)

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
W

W.G. Ryan eMVP

Comments inline:


--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
Catullus said:
Hi everyone,
I'm a n00b on VB.net programming and now I stumbled upon a problem I
can't solve, even after browsing the net for hours..

I have a dataview witg 4 columns; 2 string columns and 2 integer
columns
I want to use the RowFilter to get the 'records' where one of the
integer columns holds a certain integer and use that dataview as
datasource for my listbox
This gives all sorts of error...
I get errors like option strict on disallows implicit
coversion from string to double
----

Thats a GOOD sign -
Isn't it possible to use integers in a rowfilter? Yes, it's possible
I can do it otherwise by looping through the dataview and where-ever
the value in the specific column matches my parameter, I can add an
Item to the listbox?
But even here I have a question; Is it possible to add besides a
displaymember also a value that isn't shown but can be called by
"SelectedValue"?
---
Don't understand what you mean? You can chnage the rowfilter when
selectedvalue changes, just dump this code sinppet in the SelectedValue
changed handler.
I really hope you guys can help me!!

Here's the code from my dataview and filter

dvaanw2.RowFilter = "activiteitID =
" + paramactid
------ This wont work if paramactid is not a string.

just do "activiteitID = " + paramactid.ToString()
 
C

Catullus

ok never mind
I'm a real idiot :p

had an error further down that I didn't notice..

for the rowfilter to work apparently you have to cast it to a string
and that works..

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
C

Cor Ligthert

Cattalus,
I'm a real idiot :p
You are from Belgium you said, I will not say that.

(Not Dutch or Begians will not understand this)

And to be serious, you found it yourself, messaged that, and told you where
an Idiot. That shows in my opinon the opposite. Some people are so stuppid
that they won't even commit that they made a mistake and leave the question
open.

So thanks for telling this to us.

:)

Cor
 

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

Top