473,385 Members | 1,347 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.

Q: Saving collections.

Hi!

Got a question, don't know if it's the right forum, but i will give it a
try.

I am building a CRM system for a customer, who has special needs.

On a task i want to be able to bind multiple contacts, like in outlook.

I use a collection of objects on the task to assign the contacts. Now i want
to store them along with the task in the database. Is there a good way to do
this or, simply have a detail table with the typ of collection and pointer
to that record?

Hmm, sorry for my bad english, i am from sweden, but i hope you get what i
want to do...

Regards

Martin Arvidson
Nov 17 '05 #1
3 1139
Martin,

You could serialize the collection and then store that in the database.
However, that will prevent you from being able to query on properties in the
database. You would have to completely load the collection/instance if you
wanted to filter on it.

This is where you need to decide what your needs are in terms of
manipulating the data on the db side.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Martin Arvidsson" <ma**********@hotmail.com> wrote in message
news:Of**************@TK2MSFTNGP12.phx.gbl...
Hi!

Got a question, don't know if it's the right forum, but i will give it a
try.

I am building a CRM system for a customer, who has special needs.

On a task i want to be able to bind multiple contacts, like in outlook.

I use a collection of objects on the task to assign the contacts. Now i
want to store them along with the task in the database. Is there a good
way to do this or, simply have a detail table with the typ of collection
and pointer to that record?

Hmm, sorry for my bad english, i am from sweden, but i hope you get what i
want to do...

Regards

Martin Arvidson

Nov 17 '05 #2
Thanx,

but I am not yet an expert in C#, any hint in where to look for an "ahhh"
experience?

Regards

Martin
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> skrev i
meddelandet news:%2****************@TK2MSFTNGP10.phx.gbl...
Martin,

You could serialize the collection and then store that in the database.
However, that will prevent you from being able to query on properties in
the database. You would have to completely load the collection/instance
if you wanted to filter on it.

This is where you need to decide what your needs are in terms of
manipulating the data on the db side.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Martin Arvidsson" <ma**********@hotmail.com> wrote in message
news:Of**************@TK2MSFTNGP12.phx.gbl...
Hi!

Got a question, don't know if it's the right forum, but i will give it a
try.

I am building a CRM system for a customer, who has special needs.

On a task i want to be able to bind multiple contacts, like in outlook.

I use a collection of objects on the task to assign the contacts. Now i
want to store them along with the task in the database. Is there a good
way to do this or, simply have a detail table with the typ of collection
and pointer to that record?

Hmm, sorry for my bad english, i am from sweden, but i hope you get what
i want to do...

Regards

Martin Arvidson


Nov 17 '05 #3
MUS
Hello Martin!

Martin i cant see any reason why you should need to persist your
task-customer collection in the database as a whole. Since this
approach will not allow you to query the contacts based on its
attributes and will do bad for the reporting purpose as well (since you
will be needing a lot of reporting incase of CRM)

Best approach will be to cater this scenario like any other 1-* case
like a simple "order-orderline case", where you have a order table and
orderline table and the orderline table holds key to its parent. On
object level it will simply be implemented by having an Order
object/bean composing (basic-composition) IList of OrderLine objects.
Then build a OrderManager which will cater the CRUD
(Create/Read/Update/Delete) task of your order and orderline beans.

For you case replace order with task and orderline with contacts. This
is the way 1-* relation are normally handled in applications and for a
CRM like enterprise application you need to adopt a de-normalize
approach (untill and unless you have some special requirements)

If you have very special need for it to really really "only be
serialized" then you need to mark the task object and the contact
object in your collection to be "[Serializable]" and then serialize
them and save them in db.

Hope this might be of some help.

Let me know in case of any inconsistancy.

Have a good day.

Regards,

Moiz Uddin Shaikh
Software Engineer
Kalsoft (Pvt) Ltd

Nov 17 '05 #4

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

Similar topics

0
by: mathieu cupryk | last post by:
in the Button1_Click I need to make the 1st column saved as readonly. How can I do this? using System; using System.Collections; using System.ComponentModel; using System.Data; using...
0
by: Luis Esteban Valencia | last post by:
in the Button1_Click I need to make the 1st column saved as readonly. How can I do this? using System; using System.Collections; using System.ComponentModel; using System.Data; using...
8
by: AxOn | last post by:
Hi, How can i save the specific RichTextBox in the selected tab if i have several tabs with RichTextBoxes in? The application is a text editor type program and when i try to save the most...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
0
by: GoCoogs | last post by:
Disclaimer: I'm a newbie that's been working with VB.net for under a month. I have two listboxes. Listbox1 contains collections. Selecting an item in listbox1 and pressing a control button sends...
4
by: Sid Price | last post by:
Hello, I have a class of objects (Device) that are managed by another object (Devices) with a collection class (DeviceCollection) inherited from Collections.Hashtable. Each of the Device objects...
0
Ajm113
by: Ajm113 | last post by:
Contributing To: Saving RichTextBox from Tab Control Ok, I have a question what would I use if I wanted to do something like a paste function in a Rich Text Box using the code on that thread?...
1
by: romcab | last post by:
Hi guys, I would like to ask your help about saving in ado.net. I was able to update it only on the display but when I check the database, it is not updated. I paste below my code and hopefully...
9
by: Yamasassy | last post by:
HI im having problems to saving to a .txt file, i need to be able to store a number of employees to this file (and beable to open and these files to load in to text boxes)and retrieve then for later...
5
by: jc | last post by:
RE: Two Classes with the same Data Structure.. saving code? Inheriting a structure? I have two classes. One in Inherits System.Collections.CollectionBase, the other does not, but they both have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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...
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
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?

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.