DataBind method

Lawrence Avery
Lawrence Avery used Ask the Experts™
on
How come sometimes you use DataBind method to bind data to a control and sometimes you don't?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Freelance programmer / Consultant
Commented:
Because some times it makes sense to bind to a data source and sometimes you want to supply the contents without automatic linking between the control and the data source.

Use the suitable tool for the job.  You can put a screw into a wall with a hammer but it usually doesn't make sense to do it that way does it?
Fernando SotoRetired
Distinguished Expert 2017
Commented:
From Microsoft documentation
Use this method to bind data from a source to a server control. This method is commonly used after retrieving a dataset through a database query. Most controls perform data binding automatically, which means that you typically do not need to call this method explicitly.
Lawrence AverySystem Developer

Author

Commented:
Good answers
Fernando SotoRetired
Distinguished Expert 2017

Commented:
Hi metro156, if one or both solutions answered your question please close the question.

Thanks.
AndyAinscowFreelance programmer / Consultant

Commented:
Seems to be what the author wanted to do.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial