473,786 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDatasourc e

hi All,

Iam having a objectdatasourc e control declared in the markup as
<asp:ObjectData Source ID="odsProperti es" runat="server"
TypeName="Syste m.Collections.I Enumerable"
SelectMethod="G etProperties"></asp:ObjectDataS ource>
Then on the code behind iam hacing a method declated like ...

public IEnumerable GetProperties()
{

return New ArrayList();
}
but i still get the following error

ObjectDataSourc e 'odsProperties' could not find a non-generic method
'GetProperties' that has no parameters.
Am i missing something ?, this is very basic and should work :)

regards

May 3 '06 #1
2 2120
Your typename should be the name of the class where the method is defined in
e.g
public class MyClass{
public IEnumerable GetProperties()
{
return New ArrayList();
}
}

so your ObjectDataSourc e should be

<asp:ObjectData Source ID="odsProperti es" runat="server"
TypeName="MyCla ss" SelectMethod="G etProperties"></asp:ObjectDataS ource>
Your previous construct would insinuate that "GetPropert ies" was a method in
the System.Collecti ons.IEnumerable class
"motorhead_mani ac" <as*****@thisis junk.com> wrote in message
news:uC******** ******@TK2MSFTN GP02.phx.gbl... hi All,

Iam having a objectdatasourc e control declared in the markup as
<asp:ObjectData Source ID="odsProperti es" runat="server"
TypeName="Syste m.Collections.I Enumerable"
SelectMethod="G etProperties"></asp:ObjectDataS ource>
Then on the code behind iam hacing a method declated like ...

public IEnumerable GetProperties()
{

return New ArrayList();
}
but i still get the following error

ObjectDataSourc e 'odsProperties' could not find a non-generic method
'GetProperties' that has no parameters.
Am i missing something ?, this is very basic and should work :)

regards

May 3 '06 #2
Onwuka,
thanks for the reply, i can see clearly now :) , iam wondering if i can
specify the control class name itself somehow :)

regards
Onwuka Emeka wrote:
Your typename should be the name of the class where the method is defined in
e.g
public class MyClass{
public IEnumerable GetProperties()
{
return New ArrayList();
}
}

so your ObjectDataSourc e should be

<asp:ObjectData Source ID="odsProperti es" runat="server"
TypeName="MyC lass" SelectMethod="G etProperties"></asp:ObjectDataS ource>

Your previous construct would insinuate that "GetPropert ies" was a method in
the System.Collecti ons.IEnumerable class
"motorhead_mani ac" <as*****@thisis junk.com> wrote in message
news:uC******** ******@TK2MSFTN GP02.phx.gbl...
hi All,

Iam having a objectdatasourc e control declared in the markup as
<asp:ObjectDa taSource ID="odsProperti es" runat="server"
TypeName="Sys tem.Collections .IEnumerable"
SelectMethod= "GetProperties" ></asp:ObjectDataS ource>
Then on the code behind iam hacing a method declated like ...

public IEnumerable GetProperties()
{

return New ArrayList();
}
but i still get the following error

ObjectDataSou rce 'odsProperties' could not find a non-generic method
'GetPropertie s' that has no parameters.
Am i missing something ?, this is very basic and should work :)

regards


May 4 '06 #3

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

Similar topics

12
8706
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press update after making changes, but I don't want that update button. How can I get the updated object when the user presses one of my other action buttons?
5
1990
by: Ole M | last post by:
I'm having some trouble using the ObjectDataSource in ASP.NET 2.0. I have a wrapper that contains the static methods for Select and Update. The Update-method takes the business object as parameter. When the Update-method is invoked by the ObjectDataSource, the object referenced is not the same object returned by the Select-method, but a new object with only the values from the Edit-template. So basically I get a reference to a useless...
3
2653
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 detail of a product. On my page I have a product name and a short description. So I declare an ObjectDataSource in my page <asp:ObjectDataSource ID="productData" runat="server" SelectMethod="GetProduct"
0
1497
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 connect to my business logic everything works fine. The problem is that I find this quite limited and I need to do some custom work with the parameters, so I am trying to code everything by hand in the code behind. >From a security perspective,...
2
6270
by: J055 | last post by:
Hi I've implemented caching for my ObjectDataSource. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" EnableCaching="True" CacheDuration="10" CacheExpirationPolicy="Sliding" SelectMethod="GetUsers" TypeName="BizObject"></asp:ObjectDataSource> This works, however I need to explicitly clear/remove the cache when I
0
1892
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 paging. The objectdatasource SelectMethod returns a dataview. When my objectdatasource is declared in the codebehind, sorting is not working and i receive following error when clicking on a datagrid's column header. I made the same test...
10
4581
by: J055 | last post by:
Hi I've been trying out SqlCacheDependency using the ObjectDataSource and SQL Server 2005. It all works quite well with the minimum of configuration, e.g. <asp:ObjectDataSource ID="odsAccounts" runat="server" ... EnableCaching="true" SqlCacheDependency="CommandNotification"> .... </asp:ObjectDataSource>
14
14659
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control so I get the ObjectDataSource. No problem ..... ObjectDataSource src = .... //is ok i have it
5
2657
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 simply working with objects in memory. So, it appears as though Microsoft requires that our datamapper classes reside inside a folder called "App_Code", and NO WHERE ELSE. So, has anyone successfully been able to place their datamappers in a...
3
11195
by: btreddy | last post by:
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.. <asp:ObjectDataSource ID="ODSEditSchedules" TypeName="Schedules" runat="server"...
0
9492
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9960
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.