Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Question about ObjectDataSource.DataObjectTypeName

Reply
Thread Tools

Question about ObjectDataSource.DataObjectTypeName

 
 
=?Utf-8?B?aGFwcHluaXUxOTg1?=
Guest
Posts: n/a
 
      06-27-2005
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...
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question row filter (more of sql query question) =?Utf-8?B?YW5kcmV3MDA3?= ASP .Net 2 10-06-2005 01:07 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57