473,385 Members | 1,326 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,385 software developers and data experts.

ObjectDataSource SelectParameters

83
Hii all,

I've a problem regarding passing select parameters to objectdatasource from code behind.

i would like to pass the select parameters to a objectdatasource ..not in the selecting or selected event of the objectdatasource but some where in the one of button click event.

i tried of adding the parameters but it didn work for me..

Expand|Select|Wrap|Line Numbers
  1. <asp:ObjectDataSource ID="ODSEditSchedules" TypeName="Schedules" runat="server" SelectMethod="GetParticipants">
  2. </asp:ObjectDataSource>
  3.  
GetParticipants is the method from DAL which takes one string as a parameter.

im adding the select parameters in a seperate button click event


Expand|Select|Wrap|Line Numbers
  1.  ObjectDataSourceEditParticipants.SelectParameters.Clear();
  2.  ObjectDataSourceEditParticipants.SelectParameters.Add("xxxxxx", xxxxxlabel.Text.ToString());
  3.  

its throwing an erro saying that there is no GetParticipants method which takes Zero parameters...

and if add the select parameters to the objectdatasource..with some default value to the parameter thn its working.
Expand|Select|Wrap|Line Numbers
  1.  <asp:ObjectDataSource ID="ODSEditSchedules" TypeName="Schedules" runat="server" SelectMethod="GetParticipants">
  2.                     <SelectParameters>
  3.                         <asp:Parameter Name="xxxx" Type="string" DefaultValue="xxxxx"/>
  4.                     </SelectParameters>
  5.                 </asp:ObjectDataSource>
  6.  
  7.  
Kindly tell me wht im missing .

Thanks in advance
BTR.
Mar 3 '09 #1
3 11138
In your code-behind, you are referencing the ObjectDataSource by 'ObjectDataSourceEditParticipants', but in your UI layer, it's id is 'ODSEditSchedules'. This seems like a different error than what you say is being reported to you but it is definitly an error.
Mar 3 '09 #2
btreddy
83
Hey sorry ..that is a typo mistake.

actually both are ODSEditSchedules.

Thanks..
BTR.
Mar 4 '09 #3
btreddy
83
Hiii,

Can anybody plz tell me where the parameter mismatch is taking place.

Thank you

BTR.
Mar 16 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: avezina | last post by:
We would like to use those new cool features of Asp.Net 2.0 like the ObjectDataSource in our project. I tried few basics examples and its work well. Let's say I have a page that displays a...
0
by: Eiriken | last post by:
Hello everyone, I am using ASP.NET 2 and trying to bind a objectdatasource to a gridview. By doing this the most common way by adding an objectdatasource to the page and by using the wizard to...
2
by: Damon | last post by:
Help! Need this fixed ASAP. I have a GridView/DetailsView master/details form set up, with both bound to separate ObjectDataSource objects. Both the GridView and the DetailsView have a...
3
by: Robert | last post by:
What is the best way to pass a parameter to an ObjectDataSource. I am able to add a new parameter to the SelectParameters, but I would like to just assign a value to an existing parmeter at...
2
by: planetthoughtful | last post by:
Hi All, I have an ASP.NET page that displays a GridView control based on an ObjectDataSource control. I'm wondering if it's possible to base the ObjectDataSource in question on a parameter...
0
by: Northern | last post by:
Hello, I have some trouble to declare and instantiate dynamically an ObjectDataSource in the codebehind file. The idea is to bind the objectdatasource to a gridview and have automate sorting and...
1
by: Roger | last post by:
Hi all On a page I am using a repeater which is linked to an ObjectDataSource (same page): <asp:Repeater ID="VideoListNewestRepeater" runat="server" DataSourceID="VideoListNewestDataSource">...
5
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are...
2
by: JJ | last post by:
How can I set an ObjectDataSource's Parameter programmatically? The slight complication here is that I want to set this NOT in the 'Selecting' method of the ObjectDataSource, but elsewhere. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.