473,399 Members | 3,832 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,399 software developers and data experts.

One more about dataset relations

Hi,

I have a data relationship which is 'orders' and 'order dates' mapped
out in a dataset with relations and viewed via two datagrids.

I have the dates broken down by week so the order dates grid shows how
many orders per week.

The weekly break down is performed in the sql query (datepart(week) etc
etc) but if there aren't any orders for that week it skips the week. So
for January it'll read

Week Month Total
1 Jan 5
2 Jan 6
4 Jan 2
....

what I would like to have is

Week Month Total
1 Jan 5
2 Jan 6
3 Jan 0
4 Jan 2
....
Now I was shown some sql code that accomplishes this via a cross join
but I noticed that it takes a little time to run and that's will a
small sampling of the data I intend to use it on.

So basically my question is, is there a better way to do this ?

Thanks

Nov 17 '05 #1
1 3507
I forgot to add that I'm wondering if there was a way to do this from
the c# side of things. Obviously some answers posted here may be to
optimize my query and use an outer join or something to that effect
rather than a cross join.

I have found I cannot use the outer join solution because my data is
mapped like so

table products (productid int, producttype int)
table sales (salesid int, datetime smalldatetime)
table saleshistory(productid int, salesid int)

and I wasn't able to create a working query using an outer join to
accomplish this thus the suggested cross join.

But mainly I was just wondering of there was a way to do this in c#?

Thanks

Nov 17 '05 #2

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

Similar topics

6
by: Jade | last post by:
Hi, I am trying to create a dataset with 6 tables and 5 relationships created between them. I am creating it in the Form_Load event. However i keep getting the following error... An unhandled...
1
by: Horatiu Ripa | last post by:
Once defined in SQL a database, with keys, indexes and relations between tables is it possible to create a DataSet to reflect all that? Basically I don't want to reestablish the relations, to set...
1
by: Fleckman | last post by:
I have a DataSet with 14 DataTables and 18 Relationships that were defined within Visual Studio .NET 2003. Everything looks OK in the visual development environment, i.e. when I preview the DataSet...
10
by: D | last post by:
hi I have a form with 2 datagrids showing related table data in a master / child or order / order details type relationship. I would like to auto select the row in the order details table which...
1
by: DaveF | last post by:
How can I retrieve display_names Dim custDS As DataSet = New DataSet Dim mySQL, mySQL2, mySQL3 As String
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
2
by: Joe | last post by:
Hi I have a dataset with 3 tables and 2 relations Is there a way to when I am at 1 row to tell if there is a relation on that row ??? I have the code hardcoded but try to make it work if the #...
2
by: Joe | last post by:
Hi I am going to receive a dataset downstream and I will not know the the fields number of field relations number of relations So I have to be flexible to take unknown data and be able to...
2
by: randy1200 | last post by:
My hope is that somebody has a thought on this, or can point to toward an article that's useful. I have the following: DataSet ds = new DataSet(); ds.ReadXml("MyData.xml"); Each MainTable...
0
by: kevlar | last post by:
I am having some problems reading xml into a dataset and having it set up the datatables within it properly. i serialize an object into xml and read that xml into the dataset and the code i am...
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: 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
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
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
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
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...
0
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...
0
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,...

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.