DataAdapter SQL string at runtime

J

John

Hi

How can I change sql command for a dataadpater at runtime? The reason I need
this is that sql syntax depends on the sorting and filtering options user
chooses and combinations are too many to add to dataadpater in dataset
designer at design time and its easier to cerate an sql dynamically instead.

Thanks

Regards
 
A

Armin Zingler

John said:
Hi

How can I change sql command for a dataadpater at runtime? The reason
I need this is that sql syntax depends on the sorting and filtering
options user chooses and combinations are too many to add to
dataadpater in dataset designer at design time and its easier to
cerate an sql dynamically instead.


You can change the DataAdapter's SelectCommand property at any time.


Armin
 
A

Armin Zingler

measekite said:
He didn't ask IF he can do it, he asked HOW to do it.

I didn't say "yes" or "no". That would've been the answer to IF. He asked
HOW to change the SQL command. I told him he can do it by changing the
SelectCommand property. As he has used the designer til now, this is the
right answer, I think. If not, he will let me know.


Armin
 

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