Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 3rd, 2008, 10:14 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Albany, NY, USA.
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default ObjectDataSource in UserControl

I have some code that is going to be used in several places in my project, and it is an ideal candidate for a UserControl. It is a search/results form. It uses an ObjectDataSource to get the results from the search criteria.

I set the properties of the ODS at runtime, in the Page_Load of the control and in the Page_Load of the host page. When the host page loads up, there are no errors, but when I run the search, I get the error, "ObjectDataSource 'odsSelector' could not find a non-generic method 'GetUnapprovedCases' that has parameters: UserCenterID, SearchType, UserCenterID1, SearchType1.".

UserCenterID1 and SearchType1 do not exist. What gives? I have a feeling I am close to the answer here, but it eludes me. Thanks in advance for your comments.

 The Page_Load of the control looks like this:

Code:
Private Shared SearchText As String = ""

Private Shared ClassName As String

Private Shared MethodName As String

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
With odsSelector

.SelectParameters.Add("UserCenterID", TypeCode.Int32, Session("UserCenterID")) 

.SelectParameters.Add("SearchType", TypeCode.String, Trim(txtSearchTypeValue.Text)) 

.SelectParameters("SearchType").DefaultValue = "LastName"

.TypeName = ClassName 
.SelectMethod = MethodName

End With

End Sub
The values for ClassName and MethodName are passed in the Host page's load event.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with ObjectDataSource miguel.ossa ASP.NET 2.0 Professional 1 February 9th, 2008 08:37 AM
ObjectDataSource Best Practices? TKelley4591 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 July 20th, 2007 02:39 PM
CH5 ObjectDataSource nabeelalkaff BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 8th, 2007 01:19 PM
Problem with ObjectDataSource... veeruu ASP.NET 2.0 Professional 0 March 2nd, 2007 07:45 AM
What does ObjectDataSource.Update do? Aaron Edwards ASP.NET 2.0 Basics 1 November 27th, 2006 05:40 PM



All times are GMT -4. The time now is 10:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.