473,785 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet question

I am creating a database application that uses the dataset.
The dataset holds three different tables.
I can access each table, no problem there. But how can I combine
data from the different tables into a new table.
Should/could I use views, relations ? It is possible to send an sql
query to my dataset?

I am hoping to avoid having to save the data in the dataset to my
database and then send a sql question down to the database and reload
everything.

Thanks
/Tommy
Nov 16 '05 #1
2 1963
Tommy,

It would be possible to create a new table where the column expressions
reference the columns in the other tables. I believe that if the values are
changed in the table, the calculated columns will have the correct value.

You can not feed a select statement to the DataTable. However, you can
call the Select method, passing in filters, which I believe can reference
related tables.

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

"Tommy Lang" <mu*****@yahoo. se> wrote in message
news:78******** *************** **@posting.goog le.com...
I am creating a database application that uses the dataset.
The dataset holds three different tables.
I can access each table, no problem there. But how can I combine
data from the different tables into a new table.
Should/could I use views, relations ? It is possible to send an sql
query to my dataset?

I am hoping to avoid having to save the data in the dataset to my
database and then send a sql question down to the database and reload
everything.

Thanks
/Tommy

Nov 16 '05 #2
Hi Nicholas and Tommy,

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:uv******** *****@TK2MSFTNG P12.phx.gbl...
Tommy,

It would be possible to create a new table where the column expressions reference the columns in the other tables. I believe that if the values are changed in the table, the calculated columns will have the correct value.


I would recomended expressions only for read-only data. If you have
editing - avoid them.
Create another table, copy the data from tables into it.
You might take a look at
HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET
http://support.microsoft.com/default...Product=adonet

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
Nov 16 '05 #3

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

Similar topics

3
378
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid question. But, I'm not proud! :-) I'm using Ado.net and I'm wanting to load a DataSet object with several independent tables. (For those who arent ADO.net programmers, a DataSet can hold multiple tables and the relationships and contraints...
15
2251
by: JIM.H. | last post by:
Hello, Can I send a dataset as a parameter into stored procedure and import data to a table in the stored procedure? Thanks, Jim.
2
1836
by: Jeff Brown | last post by:
OK i have came to the conclusion that since this app will be run on multiple computers that loading a complete database and then updating on exit is a moot point. I have tried several ideas submitted, but i am unable to get one of them to work completely. Here is the code i had before i realized that when i filled the dataset in the form load procedure that it would "ruin, replace, mess up" the dataset named the same thing on the other form....
22
25607
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet = ws.VerifySku(cartSet)
1
3742
by: liming | last post by:
I have installed postgresql 8.3.1,import data from a dB to another one.I work in pgadmin 3 . When I choose a table ,select the characteristic?it shows the problem below? Error:relation "pg_autovacuum" does not exit? Line1?select* from pg_autovacuum where vacrelid=26769::oid what is the problem? How to solve it?
0
9484
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9957
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.