RowFilter Failing

G

Guest

I hope someone royally owns me using my own stupidity but follow this
thought process if you will.
vs.net 2003 .net 1.1, MSDE

I have a table with three fields:
PatientsDisplayImageTypes
PatientsDisplayImageTypeID (GUID), PatientID (Guid), ImageTypeID (Guid)
PK FK FK

I fill my dataset using the dataAdapter ("Select * from
PatientsDisplayImageTypes", conSLDB)
da.fill(ds, "DisplayImages")

I then create a view upon the datatable

Dim vueDisplayImages As New DataView(ds.Tables("DisplayImages"), "",
"ImageTypeID", DataRowViewState.CurrentRows) *** IF i were to be owned I
believe this line could be it, perhaps need to use a different row state.

So now I have my view.

I then select a PatientID as a GUID from a working list, and this is where
it gets interesting. (Have verified PatientID to be valid during Debugging,
and records exist in the Sql (PatientsDisplayImageTypes) data table (Verified
directly using enterprise manager)

I set vueDisplayImages.rowfilter = "PatientID = '{" & PatientID.toString &
"}')
vueDisplayImages.Count is 0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Hence my problem. So patient ID is valid. Syntax for rowfilter is valid(?).
Records exist in the underlying SQL table. Used a select * to fill the ds,
with no where condition, hence if record is in the SQL table, it is now in my
dataset.

Does this sound like a .net bug?
 
G

Guest

Hi Spence,

Try

vueDisplayImages.rowfilter = "PatientID =" & PatientID

If in datatable PatientID's data type is string, try

vueDisplayImages.rowfilter = "PatientID ='" & PatientID +& "'"


HTH

Elton Wang
 
G

Guest

nope, as PatientID returns guid not string. The rowfilter inherently is a
string !? I understand it makes certain things simpler, but they went strong
typed on everything else, why not the rowfilter?

Either way, that syntax doesn't compile.

The error relates to the rowfilter working incorrectly, or I've done
something stupid further up in my code. My question is if I have created all
my objects correctly, why is the rowfilter excluding all rows INCLUDING the
rows that I wish to keep. I can't exactly iterate through 7000 rows to
verify that the record I need is there, and its consistent on all 7000
records to not identify the right patientID.
 
G

Guest

DataView.Rowfilter follows SQL query syntax (without WHERE). What I mean is
that if data type of condition field is string type, the query value should
in the single quotation marks. If it's numeric type, quotation marks should
not be used.
 
G

Guest

Hi,

rowFilter acts the same way as a where clause in SQL and SQL WHERE clause
doesnt support GUID and image types.

I hope this helps

Mahesh B.
 
G

Guest

PatientID = '{00000000-0000-0000-0000-000000000000}' Is the correct syntax
for equating a GUID. I have used this before in my code and it works
perfectly. Is there documentation on the Dataview to the effect of it not
working on GUID filtering? Or were you simply unaware of the syntax to equate
a guid?

Furthermore, I don't particularly want to inner join and search for names,
as there may be many people with the same name (it happens in our
developement environment, thus I must use the unique ID to search.

I really do appreciate the comments, it lets us exhaust all other
possibilities :)
 

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