473,387 Members | 1,791 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.

class design problem & databinding

Hello,

I am facing a design problem here & need your expert design advice on
this.
Scenario:

I have a class called Vendor - which has several simple attributes like
Name, Address etc
Now, each vendor has some attributes - which are not "simple"
Basically, they can be an instance of another class

for eg
Vendor
Name (string)
ContactPerson (Person)
Name (string)
Phone (string)
City

Here, VendorName, city comes from 1 table & Contact Person data comes
from another table

What is the ideal way to make sure that I have an object instance
filled up?
i.e. load the data up-front
Vendor v = Utility.GetVendor("111"); //this will query & fill Vendor as
well as ContactPerson info
(constructs the object entirely - even though some properties might not
be read at all)

or query it seperately based on what is needed ?

Now, I need to display Vendor Name, ContactPersonName in some container
using databinding.

If it were look like below, it would be a straight binding

Vendor
Name (string)
ContactPersonName (string)
ContactPersonPhone (string)
City
Is the design 1 valid design?
If design 1 is valid, how do I achieve databinding?

Is design 2 valid - as it helps to achieve databinding ?

I hope this is enough to explain the scenario
If not please post it here - so that I can elaborate it

Kalpesh

Feb 1 '06 #1
2 1396
Can anybody advice me on this?

Kalpesh

Feb 2 '06 #2
Experts please !!!!

Kalpesh

Feb 2 '06 #3

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

Similar topics

0
by: Richard | last post by:
Hi, I'm having issues with DataBinding. I have a Form with two data bound comboboxes on it. When you select something in one combobox I may {or may not} want to change the selected item in the...
5
by: sdbranum | last post by:
I have been using Visual C#.NET to code a large project having many data adapters, data sets, datagrids, multiple forms with tab pages, each containing various controls (mostly label, text boxes,...
6
by: eye5600 | last post by:
Is there a cure for the problems using databinding with a DateTimePicker? I find that a) sometimes it works, sometimes it doesn't, and b) it fails silently causing all databinding on the DataSet...
1
by: Vik | last post by:
Concatenation operator & used in the databinding expressions for the datagrid template columns appears as '&' in HTML. It causes an error when opening the pages. I have to replace '&' by '&' each...
2
by: Colin Robinson | last post by:
Help please I have an example class called Person with 2 public properties Firstname and Lastname, I cant create a textbox on an asp.net form bound to the Person.Firstname property Can...
6
by: M | last post by:
I binding controls to a dataset at design time. I find the checkboxs will cause the program crash when one of these databinding fields is dbnull. The only way for me is not set databindings for...
3
by: Trammel | last post by:
Hi, I recently upgraded to VB.net from VB6.. and woah... I feel lost :¬O One of my reasons for upgrading is I was told that VB.net can do class inheritance and subclassing easier. ...
0
by: Kalpesh | last post by:
Hello, I am facing a design problem here & need your expert design advice on this. Scenario: I have a class called Vendor - which has several simple attributes like Name, Address etc Now,...
1
by: Mark Olbert | last post by:
Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So far I've spent going on two days trying to get the following...
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: 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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.