Re-Use the asp:ObjectDataSource control
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
Does anyone know how to re-use the asp:ObjectDataSource control?
What I want to do is add ONE asp:ObjectDataSource control to my Web form,
then BIND it to MULTIPLE DropDownList boxes in the Code Behind, since the
DropDownList boxes will all reference the same Stored Procedure. However,
you can not do that since that ObjectDataSource is already bound to another
control on the form. The only way I know to do this is to add multiple
asp:ObjectDataSource controls to the form with their own unique ID, which
seems redundant if all the ObjectDataSources will use the same store
procedure with the same parameters.
In the Code Behind, how can I create a NEW instance of the
asp:ObjectDataSource control for each of the DropDownList boxes I want to
BIND to?
.
Relevant Pages
- Re: Simple Threading Problem with WinForm
... // The delegate to call the method to set the data source. ... including your update of the status bar. ... Also, if you bind to dsLocal.Tables, the data grid will automatically ... > StatusBar control. ... (microsoft.public.dotnet.languages.csharp) - Re: ADO Form bind
... I needed this Inconsistant updates so the user can edit the data - however, ... I do not want the data that was updated in a particular control to update the ... I don't believe you can bind an updatable form ... (microsoft.public.access.formscoding) - Re: Haunted Visual Studio
... It is not the events on the control, ... dataset it works, but if I bind them to a dataview, it won't work, however a ... new texbox bound to the dataview works just fine! ... >>If I drag that on the tab control, it again goes blank, now even if I drag ... (microsoft.public.dotnet.framework.windowsforms) - Re: Haunted Visual Studio
... It is not the events on the control, ... dataset it works, but if I bind them to a dataview, it won't work, however a ... new texbox bound to the dataview works just fine! ... >>If I drag that on the tab control, it again goes blank, now even if I drag ... (microsoft.public.dotnet.framework.windowsforms.controls) - Re: HOW TO: Create a single DataSet bound object used by 50 DropDownList box controls in the same
... Simply reuse the bind code. ... Encapsulate the bind into a routine and pass the dropdowns in, ... Make a user control that caches the output. ... (microsoft.public.dotnet.framework.adonet) |
|