using DataViews to get a filtered result set back

  • Thread starter Thread starter J. C. Clay
  • Start date Start date
J

J. C. Clay

I'm a creating a dataView in the following manner:

VW_PRODMAIN = new DataView(ProdMain,"product_id='" + this.PRODUCT_ID +
"'" ,"product_id",DataViewRowState.CurrentRows);


when I do it in this manner I do not get any records in my DataView.

If I hard code the product_id in

VW_PRODMAIN = new DataView(ProdMain,"product_id='03feeadf-5c53-43ee-96ef-a88cd8b2d022'"
,"product_id",DataViewRowState.CurrentRows);

the DataView is populated with one record.

Does anyone know why the example on top will not work

I am using a String to define this.PRODUCT_ID

When I query ?VW_PRODMAIN.RowFilter in the Debugger I get the same
result for both the above examples.

I've tried converting the PRODUCT_ID into type Guid but this hasn't
worked either.


thanks

-- J.C. Klay
 
What can I say? Compare the following two expressions and see where they
differ.

"product_id='" + this.PRODUCT_ID + "'"
"product_id='03feeadf-5c53-43ee-96ef-a88cd8b2d022'"

If there ain't a typo, then there's gotta be something different in these
expressions.
 
Back
Top