473,602 Members | 2,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about ObjectDataSourc e.DataObjectTyp eName

It's serious.

This is my interface:
public interface IData
{
Guid UserId { get; set; }
string IDataType { get; }
}

and my class:
public class StudentData : IData
{
private Guid userId = Guid.Empty;
public Guid UserId { ... }

private string name = "";
public string Name { ... }

private int age = 0;
public int Age { ... }
}

and the data provider
public class FormViewDataPro vider
{
... // Codes to get the data

public void Set(IData i) // Update Method
{
...
}
}

now if i copy all the codes into a windows application and call it like the
following:

StudentData s = new StudentData();
FormViewDataPro vider fvdp = new FormViewDataPro vider();
fvdp.Set(s);

it'll work well

but if i use ObjectDataProvi der and FormView and set ObjectDataProvi der's
property ObjectDataTypeN ame = StudentData, when i update the FormView it'll
throw an exception:

ObjectDataSourc e 'ObjectDataSour ce2' could not find a non-generic method
'Set' that takes parameters of type 'StudentData'.

could somebody help me?

Stack Trace:

[InvalidOperatio nException: ObjectDataSourc e 'ObjectDataSour ce2' could not
find a non-generic method 'Set' that takes parameters of type 'StudentData'.]
System.Web.UI.W ebControls.Obje ctDataSourceVie w.GetResolvedMe thodData(Type
type, String methodName, Type dataObjectType, Object oldDataObject, Object
newDataObject, DataSourceOpera tion operation) +664
System.Web.UI.W ebControls.Obje ctDataSourceVie w.ExecuteUpdate (IDictionary
keys, IDictionary values, IDictionary oldValues) +1512
System.Web.UI.D ataSourceView.U pdate(IDictiona ry keys, IDictionary values,
IDictionary oldValues, DataSourceViewO perationCallbac k callback) +179
System.Web.UI.W ebControls.Form View.HandleUpda te(String commandArg,
Boolean causesValidatio n) +1187
System.Web.UI.W ebControls.Form View.HandleEven t(EventArgs e, Boolean
causesValidatio n, String validationGroup ) +851
System.Web.UI.W ebControls.Form View.OnBubbleEv ent(Object source, EventArgs
e) +163
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args) +56
System.Web.UI.W ebControls.Form ViewRow.OnBubbl eEvent(Object source,
EventArgs e) +118
System.Web.UI.C ontrol.RaiseBub bleEvent(Object source, EventArgs args) +56
System.Web.UI.W ebControls.Link Button.OnComman d(CommandEventA rgs e) +107
System.Web.UI.W ebControls.Link Button.RaisePos tBackEvent(Stri ng
eventArgument) +165

System.Web.UI.W ebControls.Link Button.System.W eb.UI.IPostBack EventHandler.Ra isePostBackEven t(String eventArgument) +31
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +32
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +244
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +3871

--
Good good study, day day up...
Nov 19 '05 #1
0 1322

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

Similar topics

3
2411
by: CWWong | last post by:
I am using DetailsView using ObjectDataSource with DataSourceTypeName assigned to the specific class. SelectMethod, UpdateMethod and DeleteMethod is working successfully, except InsertMethod. The error msg returned is: Cannot insert the employee. With tracing trigger on, I had discovered that the parameter is actually empty. The data entered is not pass into the parameter at all !!! What could be the possible reason?
1
6816
by: Dabbler | last post by:
I have a FormView tied to ObjectDataSource that's not updating and am wondering what I missed.. <asp:FormView ID="fvRegDetail" runat="server" DefaultMode="Edit" DataKeyNames="RegistrantId" DataSourceID="odsRegistrant" CssClass="waFormView" > <EditItemTemplate> .... <asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" ValidationGroup="regForm">
1
2694
by: Phillip Ian | last post by:
I've got the following: <asp:ObjectDataSource ID="lu" runat="server" TypeName="cFactory" SelectMethod="GetLookup" UpdateMethod="UpdateLookup" DataObjectTypeName="cLookupItem"> <SelectParameters> <asp:QueryStringParameter Name="which" QueryStringField="lookup" /> </SelectParameters> <UpdateParameters>
1
1922
by: Jürgen Bayer | last post by:
Hi, I just tried out the ObjectDataSource of ASP.NET 2.0. A simple application works with a GridView bound to an ObjectDataSource. The ObjectDataSource is set to a (factory) class (PersonFactory) with static methods (Select, Update, Delete, see below). The factory methods work with instances of a simple class (Person, see below). Select and Update works, but the Person object passed to the Delete method is always empty (Id == 0;...
1
2078
by: MTomov | last post by:
Hi fellas, has anyone managed to get ObjectDataSource to work Datasets where the Dataset is used as BusinessEntity class? What I mean is the following architecture: 1.WebPage with ObjectDataSource 2. CustomBusinessObject which * does validation,
3
3541
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 tables. My FormView has controls that are bound to the fiuelds on the dataset table. I am now changing the FormView's Default Mode to Edit but I am having problems with the related fields. My ObjectDataSource is defined as: ...
0
3606
by: Anabela Silva | last post by:
To anyone who has experienced this problem! Could not find a property named '... ' on the type specified by the DataObjectTypeName property in ObjectDataSource '...' I've been looking at forums about the problem that devellopers have in using ObjectDataSource when trying to update or delete a record. There has been a lot of talk like... you have to implement a list if you wanna use direct methods in such operations, etc etc
5
2640
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...
9
8816
by: Kernel Bling | last post by:
Hi Everyone, This Saturday the stage was set. The problem simply could not go on existing -- it had to be solved. Many hours, articles, compilations and frustrations later I still did not find an answer. Even pacing around my flat until I nearly went into an altered state of reality proved futile. So here is the problem... When I link up the ObjectDataSource UpdateMethod to a method in the
0
7921
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
8404
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...
1
8056
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6730
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
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
3901
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
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1256
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.