Control References in DataAdapter Commands

  • Thread starter Thread starter Christopher Weaver
  • Start date Start date
C

Christopher Weaver

How do I reference one of the properties of a form control within a SQL
Command of a DataAdapter? Do I have to do this dynamically within code or
can it be done within the CommandText property editor?
 
Never Mind! I got it.

This works if you ignore the line breaks. (And, for those who don't
recognize it, I'm in dialect 3, hence all the quotes.)

string sCategory = cbCategoryLookUp.Text;
odbcDA_SubCategoryLookUp.SelectCommand.CommandText = "SELECT DISTINCT
\"SubCategory\" FROM \"tblSubCategory\" WHERE \"Category\" = '" + sCategory
+"'";
 
Back
Top