473,387 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ObjectDataSource method parameters

Hi

I've got an update business object method which takes about 80 parameters.
I'm getting the 'could not find a non-generic method' error. I know that the
ObjectDataSource UpdateParameters matches the business object method
signiture. I ran the code below to discover that the InputParameters is in
fact a list of bound values in my FormView control, i.e. not the
UpdateParameters list.

protected void ObjectDataSource_Updating(object sender,
ObjectDataSourceMethodEventArgs e)
{
foreach (DictionaryEntry var in e.InputParameters)
{
Response.Write(var.Key.ToString() + "\n");
}
}

What is the purpose of the UpdateParameters if they don't get used? What am
I doing wrong or what do I need to understand about the ObjectDataSource
when using in this context?

Many thanks
Andrew
Nov 8 '07 #1
5 3186
Hi Andrew,

The new question you mentioned is a good idea. I haven't ever tried it(use
usercontrol as a shared template). However, I do know that you can define a
separate template file (which contains the ascx like markup in it) and
other DataBound control (which use template column) can dynanically
construct the template column by loading the template content from that
separate template file. Here are some articles introducing ASP.NET template
and how to can deal with it(dynamically load it):

#Loading ASP.NET Templates Dynamically
http://www.dotnetheaven.com/UploadFi...5112005005542A
M/DynamicTemplate.aspx?ArticleID=6d76b182-d79f-49a3-99d1-f063bae3a930

#Differences in ASP.NETĄŻs LoadControl vs. LoadTemplate
http://aspalliance.com/399

#Understanding Templates in ASP.NET
http://msdn.microsoft.com/msdnmag/issues/02/01/cutting/

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
>From: "J055" <j0**@newsgroups.nospam>
References: <uw**************@TK2MSFTNGP03.phx.gbl>
<vj*************@TK2MSFTNGHUB02.phx.gbl>
>Subject: Re: ObjectDataSource method parameters
Date: Tue, 13 Nov 2007 18:34:59 -0000

Hi Steven

I've created an object to use instead of the parameters collection. This
is
>working much better. I came across the bug which incorrectly formats en-gb
dates as en-us dates. I've managed to add some code to explicitly convert
the strings to dates in the FormView Updating event before the
ObjectDataSourceView calls it's ConvertType method.

I have another question if you don't mind. I have got the form for the
FormView edit template working. As it has a large number of controls I'd
like to share this with the Insert template. The forms essentially contain
the same controls, with a couple of omissions in the Insert mode). It
would
>make sense to me if I could create a UserControl and then use it in both
the
>FormView templates. Is this a good idea? I haven't seen any examples. I'm
wondering how much work is required to make sure I can call the necessary
ObjectDataSource and FormView events/methods for example. Do you have any
examples or perhaps you could give me your opinion or any suggestions?

Thanks again
Andrew
Nov 14 '07 #2
Hi Steven

Thanks for the articles about template controls. I've managed to get a
FormView to load templates dynamically. However it appears loading controls
this way is not compatable with 2 way databinding. Do you know if this is
possible without a lot of work?

Many thanks
Andrew
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:UO****************@TK2MSFTNGHUB02.phx.gbl...
Hi Andrew,

The new question you mentioned is a good idea. I haven't ever tried it(use
usercontrol as a shared template). However, I do know that you can define
a
separate template file (which contains the ascx like markup in it) and
other DataBound control (which use template column) can dynanically
construct the template column by loading the template content from that
separate template file. Here are some articles introducing ASP.NET
template
and how to can deal with it(dynamically load it):

#Loading ASP.NET Templates Dynamically
http://www.dotnetheaven.com/UploadFi...5112005005542A
M/DynamicTemplate.aspx?ArticleID=6d76b182-d79f-49a3-99d1-f063bae3a930

#Differences in ASP.NETĄŻs LoadControl vs. LoadTemplate
http://aspalliance.com/399

#Understanding Templates in ASP.NET
http://msdn.microsoft.com/msdnmag/issues/02/01/cutting/

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.



--------------------
>>From: "J055" <j0**@newsgroups.nospam>
References: <uw**************@TK2MSFTNGP03.phx.gbl>
<vj*************@TK2MSFTNGHUB02.phx.gbl>
>>Subject: Re: ObjectDataSource method parameters
Date: Tue, 13 Nov 2007 18:34:59 -0000

Hi Steven

I've created an object to use instead of the parameters collection. This
is
>>working much better. I came across the bug which incorrectly formats en-gb
dates as en-us dates. I've managed to add some code to explicitly convert
the strings to dates in the FormView Updating event before the
ObjectDataSourceView calls it's ConvertType method.

I have another question if you don't mind. I have got the form for the
FormView edit template working. As it has a large number of controls I'd
like to share this with the Insert template. The forms essentially contain
the same controls, with a couple of omissions in the Insert mode). It
would
>>make sense to me if I could create a UserControl and then use it in both
the
>>FormView templates. Is this a good idea? I haven't seen any examples. I'm
wondering how much work is required to make sure I can call the necessary
ObjectDataSource and FormView events/methods for example. Do you have any
examples or perhaps you could give me your opinion or any suggestions?

Thanks again
Andrew

Nov 18 '07 #3
Hi

Just wondered if this thread was still open and if there is any answer to
the question about using a separate template file in a FormView control with
2 way binding. Please see previous posts.

Thanks
Andrew
Dec 11 '07 #4
Hi Andrew,

Glad to hear from you. For the previous thread, due to some tool problem, I
haven't seen your last reply and I've manually query the web interface and
see it. So the new problem you meet is that you cannot get two-way
databinding work with dynamically loaded FormView template right?

I have also performed some test on my side and did found the problem
behavior you mentioend. It seems the "Bind" based two-way databinding will
not work(the update parameters are not automatically populated) when the
template is dynamically loaded from an separate file. Currently I'll do
some further research on this to see whether this is expected behavior or
not.

I'll update you as soon as I get any new information.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "J055" <j0**@newsgroups.nospam>
References: <uw**************@TK2MSFTNGP03.phx.gbl>
<vj*************@TK2MSFTNGHUB02.phx.gbl>
<Oj**************@TK2MSFTNGP02.phx.gbl>
<UO**************@TK2MSFTNGHUB02.phx.gbl>
<ui**************@TK2MSFTNGP02.phx.gbl>
>Subject: Re: ObjectDataSource method parameters
Date: Tue, 11 Dec 2007 14:32:15 -0000
>Hi

Just wondered if this thread was still open and if there is any answer to
the question about using a separate template file in a FormView control
with
>2 way binding. Please see previous posts.

Thanks
Andrew
Dec 12 '07 #5
Hi Andrew,

Here is something I've found. This issue does have been recorded since some
other members ever reported it previously. Here is a public web link to the
issue:

https://connect.microsoft.com/Visual...ck.aspx?Feedba
ckID=104085

also, due to some design limitation, it is still unfixed in the latest .net
framework. However, the issue link does provide a workaround, you can visit
the following link to get the idea:

#Dynamically loading an IBindableTemplate
http://www.developerfusion.co.uk/show/4721/

Hope this helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: st*****@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Wed, 12 Dec 2007 03:51:40 GMT
Subject: Re: ObjectDataSource method parameters
>
Hi Andrew,

Glad to hear from you. For the previous thread, due to some tool problem,
I
>haven't seen your last reply and I've manually query the web interface and
see it. So the new problem you meet is that you cannot get two-way
databinding work with dynamically loaded FormView template right?

I have also performed some test on my side and did found the problem
behavior you mentioend. It seems the "Bind" based two-way databinding will
not work(the update parameters are not automatically populated) when the
template is dynamically loaded from an separate file. Currently I'll do
some further research on this to see whether this is expected behavior or
not.

I'll update you as soon as I get any new information.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>>From: "J055" <j0**@newsgroups.nospam>
References: <uw**************@TK2MSFTNGP03.phx.gbl>
<vj*************@TK2MSFTNGHUB02.phx.gbl>
<Oj**************@TK2MSFTNGP02.phx.gbl>
<UO**************@TK2MSFTNGHUB02.phx.gbl>
<ui**************@TK2MSFTNGP02.phx.gbl>
>>Subject: Re: ObjectDataSource method parameters
Date: Tue, 11 Dec 2007 14:32:15 -0000
>>Hi

Just wondered if this thread was still open and if there is any answer to
the question about using a separate template file in a FormView control
with
>>2 way binding. Please see previous posts.

Thanks
Andrew

Dec 12 '07 #6

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

Similar topics

1
by: Dotnet Gruven | last post by:
I've posted this in the adonet group, however it was suggested I might have better luck here.... ============================================================= I'm trying to use a typed dataset and...
12
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...
3
by: mthomason | last post by:
I keep getting this error when trying to update records using an ObjectDataSource. I have seen others post similar errors...but I haven't found any solutions. ObjectDataSource...
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: tparks69 | last post by:
I get the error: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Insert' that has parameters: last_name, first_name, email, role_id, user_id, modified_by, modified_date...
4
by: tim.cavins | last post by:
I have a GridView populated by an ObjectDataSource. I am having issues passing the parameters to the objectdatasource. I have verified that the method is being called but none of the parameters...
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...
2
by: rgparkins | last post by:
So, I've bitten the bullet and am converting some of my asp.net 1.1 sites to asp.net 2.0, now after many issues I have come to a stop with the objectdatasource and gridviews and maybe someone can...
1
by: Max2006 | last post by:
Hi, I am truing to find a pattern for my Business Logic Layer to be able to work fine win ObjectDataSource's Update method. The challenge is ObjectDataSource is not able to work with an...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.