473,703 Members | 2,804 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 1329

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

Similar topics

3
2422
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
6823
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
2707
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
1926
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
2083
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
3548
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
3634
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
2649
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
8830
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
8739
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9234
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
9089
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
8983
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
8941
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...
1
6575
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
5910
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
4668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2037
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.