473,385 Members | 1,838 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,385 software developers and data experts.

Parent - Child Objects - Objectdatasource problems - Typed Databinding

Hi my name is Kevin

I am currently working on a Asp 2.0 project
and im having some ObjectDataSource Problems

The thing is i have a Class called User
and a Bussiness Logic Layer FcUser with the functions GetAllUsers,
GetUserByID(int) and a InsertUser(BoUser as User), the both return a generic
list of User objects, the insert method sends a User object from my UI
provided by the ObjectDatasource

On my webform im using a gridview to show all the Users by Name and i setted
the datakeysnames property
on the Primary key of my User Table, then when i select a User i will call
the details in a detailgridview wich is on the same page with the
SelectUserByID from my BL layer

Now this works, i see the details on my detail grid view
next i want to add a new user so i select Insert

My insertItemTemplate shows up, so now i can enter the data in my bound
Fields

(they are all correctly bound to the properties of my user object my User
object holds a Firstname, lastname,... and a location object)

Now the problem is that my User object also holds a location wich in my
Database is an ID and in my App is a Location Object

And i want to select a new Location to put the User in

So i have on my insertitemtemplate a dropdownlist wich selects all locations
from my database in a collection of location objects
and has a seperate objectdatasource just to select all locations ion my DB

Now when i debug or enter the method insertUser
all my fields are filled in correctly but the location object under my
object User is "nothing" and i have selected a location from the
dropdownlist
and setted the value in the LocationID and the datatextfield on LocationName

This is weird because normally the parameters from a insert or update method
will hold the values selected with the select method

Maybe someone could tell me how to enter the location Object in the User
object when i insert a User, so that when i look at the User object when
inserting a user, the property Location (wich is type Location object) hols
the selected object from the location Dropdownlist
Kind regards

Kevin Vercauteren


Aug 22 '06 #1
0 1445

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

Similar topics

16
by: Suzanne Vogel | last post by:
Hi, I've been trying to write a function to test whether one class is derived from another class. I am given only id's of the two classes. Therefore, direct use of template methods is not an...
25
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I...
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...
5
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...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
0
by: Coco | last post by:
Hi, who knows how to update the 'child' textboxes in a datarelated situation if the child records "doesn't yet exitsts/are still empty"? The problem can be explained with the Northwind database....
10
by: Goran Djuranovic | last post by:
Hi all, Does anyone know how to declare a variable in a class to be accessible ONLY from a classes instantiated within that class? For example: ************* CODE ***************** Public...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
8
by: Rick | last post by:
VS 2005 I' m setting up a parent/child datagridviews in a form. I am doing a lot of this by hand coding in order to get the feel of things. I want a change in the parent table to trigger a...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.