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

Dataset > SelectMethod > but with parameters

145 100+
I followed this link. It works but in my method I have to pass a parameter. Prod_ID.


http://asp-net-example.blogspot.com/...w-to_3173.html

1. Class is done
2. I just dont know how to pass the parameter from the product.aspx page. I am getting ObjectDataSource 'dsObj' could not find a non-generic method 'GetProducts' that has no parameters.

any help??
Apr 7 '09 #1
2 3998
Frinavale
9,735 Expert Mod 8TB
It might help if you actually post your code instead of a link to someone else's code ;)


Anyways, you need to use the ObjectDataSource's SelectParameters to provide parameters for your select method.

For example:
Expand|Select|Wrap|Line Numbers
  1.       <asp:objectdatasource
  2.           id="dsObj"
  3.           runat="server"
  4.           selectmethod="GetProducts"
  5.           typename="MyNamespace.Products" >
  6.           <selectparameters>
  7.             <asp:querystringparameter name="Prod_ID" querystringfield="ProdID" defaultvalue="-1" />
  8.           </selectparameters>
  9.         </asp:objectdatasource>
-Frinny
Apr 7 '09 #2
dorandoran
145 100+
Hello Frinny,

Perfect solution. It helped. As for the posting someone else's post; I used his code line by line except I added parameter (the id part). I thought it will be easier for reader.

Again thanks a lot for your help. I truly appreciate it. Have a magical and beautiful day.

DD
Apr 7 '09 #3

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

Similar topics

1
by: | last post by:
Hi, I've defined an ObjectDataSource and a parameterized DataSet. I would like it if I could pass the parameter value that describes the query that creates the DataSet as part of a user control...
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...
5
by: David Harris | last post by:
I am developing a type of data warehouse. Basically, we have 20 client survey machines that are each separated from the server by space and lack of network. Yet both need to speak to each other...
6
by: Nick | last post by:
I have a code that returns data in IList. My webGrid doesn't allow me to sort with IList returned, it say it only suports DataView, DataTable and DataSet, not IEnumerable. I don't know how to...
0
by: ~john | last post by:
I have an ObjectDataSource pointing at a class, which based on the SelectMethod and the parameter passed to it, returns an Object of my custom class. The SelectMethod is something like...
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">...
0
by: jobs | last post by:
re: ObjectDataSource SelectMethod TypeName returning a Dataset? is this really a DAL? Pardon my misguided email on the subject... I'm working in asp.net 2.0 and vb.net 2005. Say I don't...
0
by: Froefel | last post by:
I'm using ObjectDataSources to access my data, and while I gathered very useful code from a variety of sources to get started, I keep running into an issue. First off, everything actually works,...
0
by: Question123 | last post by:
Hello.. i want to pass 3 parameters for SelectMethod and 1 parameters for SelectCountMethod of ObjectDataSource. How can i pass these?? And how ObjectDataSource can distinguish which...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
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...
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...
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...

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.