473,466 Members | 1,366 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question about ObjectDataSource.DataObjectTypeName

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 FormViewDataProvider
{
... // 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();
FormViewDataProvider fvdp = new FormViewDataProvider();
fvdp.Set(s);

it'll work well

but if i use ObjectDataProvider and FormView and set ObjectDataProvider's
property ObjectDataTypeName = StudentData, when i update the FormView it'll
throw an exception:

ObjectDataSource 'ObjectDataSource2' could not find a non-generic method
'Set' that takes parameters of type 'StudentData'.

could somebody help me?

Stack Trace:

[InvalidOperationException: ObjectDataSource 'ObjectDataSource2' could not
find a non-generic method 'Set' that takes parameters of type 'StudentData'.]
System.Web.UI.WebControls.ObjectDataSourceView.Get ResolvedMethodData(Type
type, String methodName, Type dataObjectType, Object oldDataObject, Object
newDataObject, DataSourceOperation operation) +664
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteUpdate(IDictionary
keys, IDictionary values, IDictionary oldValues) +1512
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values,
IDictionary oldValues, DataSourceViewOperationCallback callback) +179
System.Web.UI.WebControls.FormView.HandleUpdate(St ring commandArg,
Boolean causesValidation) +1187
System.Web.UI.WebControls.FormView.HandleEvent(Eve ntArgs e, Boolean
causesValidation, String validationGroup) +851
System.Web.UI.WebControls.FormView.OnBubbleEvent(O bject source, EventArgs
e) +163
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.FormViewRow.OnBubbleEven t(Object source,
EventArgs e) +118
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.LinkButton.OnCommand(Com mandEventArgs e) +107
System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String
eventArgument) +165

System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3871

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

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

Similar topics

3
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...
1
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"...
1
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">...
1
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...
1
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...
3
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...
0
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...
5
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...
9
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...
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...
0
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,...
0
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...
1
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...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.