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

Interesting CMS solution required

Hi All,

I have been asked to uild an ASP.Net 2.0 CMS in c# for a client that
will display their products, not a problem for the majority! The main
stumbling lock i have run into is that each product has a range of
product codes that have different attributes associated with them, eg:

PRODUCT 1

Product Code Diameter Pack Size
pc1-1 12mm 100
pc1-2 14mm 200
pc1-3 100mm 300

PRODUCT 2

Product Code Width Height Depth
pc2-1 12m 10 12
pc2-2 140m 20 13
pc2-3 100m 30 30

as you can see each product code has any numer of associated
properties, for this reason i cannot just build a full table and
display the data as i normally would. My main method of thinking is to
build a database table that only has three columns ProductCode,
Property, Value

Is this a good idea, can i then display these values suitably grouped
in a table using ASP.Net??

Am i totally on the right/wrong track??, any advice or links to
related articles greatly appreciated as this isnt a problem i have
faced before.. But i am a quick learner :)

Many thanks in advance

Anthony

May 27 '07 #1
8 999
On May 27, 8:09 pm, anthonykal...@googlemail.com wrote:
Hi All,

I have been asked to uild an ASP.Net 2.0 CMS in c# for a client that
will display their products, not a problem for the majority! The main
stumbling lock i have run into is that each product has a range of
product codes that have different attributes associated with them, eg:

PRODUCT 1

Product Code Diameter Pack Size
pc1-1 12mm 100
pc1-2 14mm 200
pc1-3 100mm 300

PRODUCT 2

Product Code Width Height Depth
pc2-1 12m 10 12
pc2-2 140m 20 13
pc2-3 100m 30 30

as you can see each product code has any numer of associated
properties, for this reason i cannot just build a full table and
display the data as i normally would. My main method of thinking is to
build a database table that only has three columns ProductCode,
Property, Value

Is this a good idea, can i then display these values suitably grouped
in a table using ASP.Net??

Am i totally on the right/wrong track??, any advice or links to
related articles greatly appreciated as this isnt a problem i have
faced before.. But i am a quick learner :)

Many thanks in advance

Anthony
ProductID Product Code
1 pc2-1
2 pc2-2
3 pc2-3

PropertyID Property Name
1 Width
2 Height

ProductID PropertyID Value
1 2 12m
2 2 14m

May 27 '07 #2
On 27 May, 19:21, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On May 27, 8:09 pm, anthonykal...@googlemail.com wrote:


Hi All,
I have been asked to uild an ASP.Net 2.0 CMS in c# for a client that
will display their products, not a problem for the majority! The main
stumbling lock i have run into is that each product has a range of
product codes that have different attributes associated with them, eg:
PRODUCT 1
Product Code Diameter Pack Size
pc1-1 12mm 100
pc1-2 14mm 200
pc1-3 100mm 300
PRODUCT 2
Product Code Width Height Depth
pc2-1 12m 10 12
pc2-2 140m 20 13
pc2-3 100m 30 30
as you can see each product code has any numer of associated
properties, for this reason i cannot just build a full table and
display the data as i normally would. My main method of thinking is to
build a database table that only has three columns ProductCode,
Property, Value
Is this a good idea, can i then display these values suitably grouped
in a table using ASP.Net??
Am i totally on the right/wrong track??, any advice or links to
related articles greatly appreciated as this isnt a problem i have
faced before.. But i am a quick learner :)
Many thanks in advance
Anthony

ProductID Product Code
1 pc2-1
2 pc2-2
3 pc2-3

PropertyID Property Name
1 Width
2 Height

ProductID PropertyID Value
1 2 12m
2 2 14m- Hide quoted text -

- Show quoted text -
Hi alexey,

Thanks for your reply, that is similar to what i had in mind although
by using the many tables it will be easier to maintain good data
integrity, do you have any advice how to display this data effectively
in asp.net, how would i group the results together to produce a neat
looking table, would i do the manipulation in a stored procedure or
in .net???

Cheers
Anthony

May 27 '07 #3
On 27 May, 20:10, anthonykal...@googlemail.com wrote:
On 27 May, 19:21, Alexey Smirnov <alexey.smir...@gmail.comwrote:


On May 27, 8:09 pm, anthonykal...@googlemail.com wrote:
Hi All,
I have been asked to uild an ASP.Net 2.0 CMS in c# for a client that
will display their products, not a problem for the majority! The main
stumbling lock i have run into is that each product has a range of
product codes that have different attributes associated with them, eg:
PRODUCT 1
Product Code Diameter Pack Size
pc1-1 12mm 100
pc1-2 14mm 200
pc1-3 100mm 300
PRODUCT 2
Product Code Width Height Depth
pc2-1 12m 10 12
pc2-2 140m 20 13
pc2-3 100m 30 30
as you can see each product code has any numer of associated
properties, for this reason i cannot just build a full table and
display the data as i normally would. My main method of thinking is to
build a database table that only has three columns ProductCode,
Property, Value
Is this a good idea, can i then display these values suitably grouped
in a table using ASP.Net??
Am i totally on the right/wrong track??, any advice or links to
related articles greatly appreciated as this isnt a problem i have
faced before.. But i am a quick learner :)
Many thanks in advance
Anthony
ProductID Product Code
1 pc2-1
2 pc2-2
3 pc2-3
PropertyID Property Name
1 Width
2 Height
ProductID PropertyID Value
1 2 12m
2 2 14m- Hide quoted text -
- Show quoted text -

Hi alexey,

Thanks for your reply, that is similar to what i had in mind although
by using the many tables it will be easier to maintain good data
integrity, do you have any advice how to display this data effectively
in asp.net, how would i group the results together to produce a neat
looking table, would i do the manipulation in a stored procedure or
in .net???

Cheers
Anthony- Hide quoted text -

- Show quoted text -
Also could you please tell me what the correct term is for this kind
of data relationship so i can search more effectively on the topic

Cheers
Anthony

May 27 '07 #4
<an***********@googlemail.comwrote in message
news:11**********************@w5g2000hsg.googlegro ups.com...
would i do the manipulation in a stored procedure or in .net???
Generally speaking, you should try to use each layer of your app for what
it's best at...

Therefore, use your data layer for data storage and retrieval, your business
layer for business logic, and your presentation layer for making it all look
good...
--
http://www.markrae.net

May 27 '07 #5
On May 27, 9:10 pm, anthonykal...@googlemail.com wrote:
Hi alexey,

Thanks for your reply, that is similar to what i had in mind although
by using the many tables it will be easier to maintain good data
integrity, do you have any advice how to display this data effectively
in asp.net, how would i group the results together to produce a neat
looking table, would i do the manipulation in a stored procedure or
in .net???

Cheers
Anthony- Hide quoted text -

- Show quoted text -
Of course, all this is a job for a database. It's up to you, if you
will generate sql on the fly or you will use a stored procedures. An
sql wouldn't be that complexed

E.g. for your one-table-approach

SELECT property, value FROM table WHERE productcode='pc2-1'

May 27 '07 #6
On 27 May, 20:49, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On May 27, 9:10 pm, anthonykal...@googlemail.com wrote:
Hi alexey,
Thanks for your reply, that is similar to what i had in mind although
by using the many tables it will be easier to maintain good data
integrity, do you have any advice how to display this data effectively
in asp.net, how would i group the results together to produce a neat
looking table, would i do the manipulation in a stored procedure or
in .net???
Cheers
Anthony- Hide quoted text -
- Show quoted text -

Of course, all this is a job for a database. It's up to you, if you
will generate sql on the fly or you will use a stored procedures. An
sql wouldn't be that complexed

E.g. for your one-table-approach

SELECT property, value FROM table WHERE productcode='pc2-1'
Thanks for all your help with this but the bit i am now struggling
with is displaying the data, after running your query for example i
get

Product Code Property Value
pc2-1 Width 100
pc2-1 Height 50

When what i really want to display is

Product Code Width Height
pc2-1 100 50

How do i go about this final manipulation to make it a readable
table??

Cheers
Anthony

May 27 '07 #7
<an***********@googlemail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
Thanks for all your help with this but the bit i am now struggling
with is displaying the data, after running your query for example i
get

Product Code Property Value
pc2-1 Width 100
pc2-1 Height 50

When what i really want to display is

Product Code Width Height
pc2-1 100 50

How do i go about this final manipulation to make it a readable
table??
Aha - well, the term for what you require is a "crosstab query"...

I'm assuming you're using SQL Server, so here's how to do it:
http://www.google.co.uk/search?sourc...er%22+crosstab
--
http://www.markrae.net

May 27 '07 #8
On May 27, 11:39 pm, anthonykal...@googlemail.com wrote:
When what i really want to display is

Product Code Width Height
pc2-1 100 50

How do i go about this final manipulation to make it a readable
table??
Anthony,

either build a stored procedure with a crosstab query, as Mark said,
or present a data using .NET. I'm not sure which approach will be the
best in your situation, you have to try and decide it. Take a look at
the following example of how it can be done using the ".NET way".

SELECT property, value FROM table WHERE productcode='pc2-1'
-------------------------------

HtmlTable t = new HtmlTable();
HtmlTableRow r1 = new HtmlTableRow();
HtmlTableRow r2 = new HtmlTableRow();

while (mySqlDataReader.Read())
{

HtmlTableCell c1 = new HtmlTableCell();
c1.Controls.Add(new
LiteralControl(mySqlDataReader["property"].ToString()));

HtmlTableCell c2 = new HtmlTableCell();
c2.Controls.Add(new
LiteralControl(mySqlDataReader["value"].ToString()));

r1.Cells.Add(c);
}

t.Rows.Add(r1);
t.Rows.Add(r2);
Place.Controls.Add(t);

It returns:
------------------------------------------------
Width Height
100 50

Cheers!

May 27 '07 #9

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

Similar topics

15
by: Nick Coghlan | last post by:
Thought some folks here might find this one interesting. No great revelations, just a fairly sensible piece on writing readable code :) The whole article:...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
56
by: Dave Vandervies | last post by:
I just fixed a bug that some of the correctness pedants around here may find useful as ammunition. The problem was that some code would, very occasionally, die with a segmentation violation...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
7
by: brad.goldberg | last post by:
I have a field that auto increments a number for each record. 0001, 0002 and so on. I also have two buttons on the form. One button is used to "save" the record after all fields are entered. After...
3
by: Raqueeb Hassan | last post by:
Hello, Given the idea of having voter ID card for all the citizens of Bangladesh, I was thinking of assessing few things before it actually starts. The election commission, the government agency...
0
by: ARC | last post by:
Well, maybe not interesting, more like hair-pulling. Ok, so if you want to code misc. utilities and forms for the office button (Like a registration screen, backup, setup options, connect to...
5
by: BEES INC | last post by:
I've been awfully busy programming lately. My Django-based side project is coming along well and I hope to have it ready for use in a few weeks. Please don't ask more about it, that's really all I...
0
by: Gary Herron | last post by:
BEES INC wrote: Much simpler this way. This produces the number of whole start and the number of half stars: v = ... calculate the average ... whole = int(v+0.25) half =...
0
by: service0031 | last post by:
Housekeeping is an interesting job or career where things are always changing, and even though you may work in a less than clean environment, you are required to always look clean and professional....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.