473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re-Use the asp:ObjectDataSource control

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?
Jul 10 '08 #1
0 1128

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Trail Monster | last post by:
Ok, I've been searching the net now for several days and can't find how to do this anywhere. Version: VS 2005 Professional Release, 2.0 Framework Background: I have a complex business object...
2
by: Nir.Hazan | last post by:
When I try to update my GridView I get the error: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: CustomerID, EmployeeID, OrderDate,...
2
by: Ian | last post by:
Hiya, Hope this isn't too stupid a question :) I can bind an objectdatasource to a gridview very easily (and there's a thousand tutorials of this on the net). BUT! I just want to get at...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
3
by: Jeronimo Bertran | last post by:
I have a FormView that shows details of a specific record on a table. The SelecMethod returns a DataSet that includes all the fields from my Event table and other read-only fields from linked...
3
by: siamesedream | last post by:
Hello, I'm having trouble using the insert method of an ObjectDataSource that uses a custom DataObjectType. If I'm using a custom DataObjectType does my insert method have to take that object,...
1
by: Tina | last post by:
I have an .XSD tableadapter whose GetData takes an int.32 argument. I created an ObjectDatasource that uses the .XSD to retrieve the data. When creating the ObjectDataSource it recognized that an...
4
by: GaryDean | last post by:
I have an objectdatasource reading a dataset and I have a gridview using that objectdatasource (at design time). It binds fine but I need to clear it. myGridView.DataSource = null:...
4
by: Sean | last post by:
I'm dynamically creating PDFs and trying to create an objectdatasource completely in the code behind, but I can't figure out how to call the selected event. Here's what I have so far... string...
5
by: J055 | last post by:
Hi I've got an update business object method which takes about 80 parameters. I'm getting the 'could not find a non-generic method' error. I know that the ObjectDataSource UpdateParameters...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.