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?
 
Thanks. Can you tell me how this would be done in code?
 
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
+"'";
 

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