473,807 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp.net databinding to objectdatasourc e

Ram

I have an issue with detailsview control bound to an objectdatasourc e.
scenario is i have a business logic component with CRUD methods that accept
custom business entity objects. In asp.net layer I'm using gridview and
detailsview controls that gets bound to an objectdatasourc e control which
uses my businesslogic CRUD methods. Now If i use all databound fields, all my
selects, inserts, updates, deletes work just fine. As soon as i convert one
field into a template field and add a dropdown control, the value that i
select in dropdown control is not bound properly to my business entity
object's property.
I'm i missing something here...

Thanks,
<Ram/>
--
Thanks,
<Ram/>
Dec 1 '05 #1
2 1582
Ram
I figured out a work around for this by implementing ItemInserting event
handler. In the iteminserting event handler i do a detailsview.fin dcontrol ,
get a reference of dropdown control, get the selected value and add it to
e.values dictionary.
My question is is this by design? why can't template fields be automatically
bound to business object?

I appreciate any feedback comments...

Thanks,
<Ram/>
"Ram" wrote:

I have an issue with detailsview control bound to an objectdatasourc e.
scenario is i have a business logic component with CRUD methods that accept
custom business entity objects. In asp.net layer I'm using gridview and
detailsview controls that gets bound to an objectdatasourc e control which
uses my businesslogic CRUD methods. Now If i use all databound fields, all my
selects, inserts, updates, deletes work just fine. As soon as i convert one
field into a template field and add a dropdown control, the value that i
select in dropdown control is not bound properly to my business entity
object's property.
I'm i missing something here...

Thanks,
<Ram/>
--
Thanks,
<Ram/>

Dec 1 '05 #2
Ram
I guess it kind of make sense, why they are not automatically bound to
business object. if you have multiple controls in template how do you know
which one gets bound to business object property.

Thanks,
<Ram/>
"Ram" wrote:
I figured out a work around for this by implementing ItemInserting event
handler. In the iteminserting event handler i do a detailsview.fin dcontrol ,
get a reference of dropdown control, get the selected value and add it to
e.values dictionary.
My question is is this by design? why can't template fields be automatically
bound to business object?

I appreciate any feedback comments...

Thanks,
<Ram/>
"Ram" wrote:

I have an issue with detailsview control bound to an objectdatasourc e.
scenario is i have a business logic component with CRUD methods that accept
custom business entity objects. In asp.net layer I'm using gridview and
detailsview controls that gets bound to an objectdatasourc e control which
uses my businesslogic CRUD methods. Now If i use all databound fields, all my
selects, inserts, updates, deletes work just fine. As soon as i convert one
field into a template field and add a dropdown control, the value that i
select in dropdown control is not bound properly to my business entity
object's property.
I'm i missing something here...

Thanks,
<Ram/>
--
Thanks,
<Ram/>

Dec 1 '05 #3

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

Similar topics

3
1866
by: John Bailey | last post by:
When I first built a few web pages in ASP .Net 2.0, I thought it was great. The formview and detailview contorls would automatically layout the controls for you, the update methods were automatically generated, and the objectdatasource let you design against a business object through the gui. Now I am working on my first real web application on 2.0, and I find this automatic functionality doesn't do much beyond allowing me to generate...
2
3767
by: ulrich schumacher | last post by:
Hi ASP.NET 2.0 Professionals, I've got a question concerning the new ASP.NET 2.0 DataBinding with object oriented business classes: Example: There are two business classes in my domain model: public class Language
1
2147
by: thzero | last post by:
Is there any way to do this without using the ObjectDataSource? (Apologies for the long post) I have a simple data object: public class TestDO { public TestDO() {} public ID { get; set; } public Name { get; set; } public Description { get; set; }
5
3486
by: Trail Monster | last post by:
Ok, I've been searching the net now for several days and can't find how to do this anywhere. Version: VS 2005 Professional Release, 2.0 Framework Background: I have a complex business object Employee that contains public properties and several nested objects such as a Spouse object and a List of Coverage objects.
0
1301
by: Simon Gregory | last post by:
I am currently attempting to figure out how the new databinding stucture works in ASP.NET 2.0 after working with v1.0 & v1.1 for several years. It seems that if you wish to do set up databinding at Design Time, you are restricted to using one of the 5 xxxDataSource controls. The data in our websites are usually obtained via a set of webservices and are contained in a set of strongly typed relational DataSets.
8
2189
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got answered... In 1.1 we always did our own myDataAdapter.fills and we liked that control for lots of good reasons. Now the new DataSource (or is it a TableAdapter:Dataset) automatically fills the Gridview. How can we control that fill? In a...
8
1836
by: Joey Chömpff | last post by:
L.S., Hello is there a way to implement 2-way databinding without using the datasources from dotnet 2.0. Why would you ask? Now that's simple. I've created an object model with BusinessObjects and I don't want to write an separate provider layer for the datasources. This is because I loose all the benefits of my objectmodel. Are there other developers who think this way?
0
1330
by: Wayne Sepega | last post by:
I have the following Object DataSource <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetCustomer" TypeName="Customers" DataObjectTypeName="Customer" InsertMethod="InsertCustomer" OnUpdated="ObjectDataSource1_Updated" UpdateMethod="UpdateCustomer" OnSelected="ObjectDataSource1_Selected">
5
2178
by: cmrchs | last post by:
Hi, I'm trying out Databinding to a Data Acces Layer using a ObjectDataSource-control The Update works fine but the Delete-method doesn't. when debugging I see that my productID-parameter is always 0 and not the ID of the selected record (which is the case when updating) How come?
0
1887
by: cmrchs | last post by:
Hi, I'm trying out Databinding to a Data Acces Layer using a GridView and ObjectDataSource-control The Update works fine but the Delete-method doesn't ??? <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" OnRowUpdating="GridView1_RowUpdating"
0
10626
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...
1
10374
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
10112
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...
0
9193
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
7650
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
6879
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();...
1
4330
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 we have to send another system
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.