Is there a difference between binding a control to a datasource in Design view and binding it in code?
Is there a difference between using one method over the other. You can either bind it in code, c开发者_运维技巧alling the appropiate method, or you can bind it using the design view by selecting a datasource to bind to.
Pretty much when working with any .NET project these two options are always available when working with data.
Exept for console apps, but thats a different story.
The designer-generated code does pretty much the same things you would do manually; it uses the same APIs you would use. Of course you can always look at what the designer does to double check.
It might be that the designer does things not as tightly as a human would, but if you throw the compiler and JIT optimizations into the picture I expect the code to be equivalent.
So in the end I 'd say its a matter of preference and convenience.
精彩评论