473,651 Members | 2,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please. join 2 tables and datagrid

I have a datagrid with 3 columns. I have 2 tables. the question is. ¿How
obtain or show in my datagrid the column1 and column2 of my fields the my
table1 and de column3 a field of my table2?

Thanks a lot.
Jun 5 '06 #1
3 1600
Not quite sure I understand your english but if you are asking this:
"How do I show 2 columns from one table, and 1 column from another
table in one table in a datagrid?" then the answer is to
programatically create a 3rd table and add the contents of the other 2
tables as necessary. Then bind your datagrid to the 3rd new table.

But of course there are many issues to consider, such as how the data
is related between the 2 tables. Is it a 1-1 relationship? If not, then
I would question what you are trying to achieve.

Also, you can always JOIN the data before you select it from the
database, that way you will only get one table back that you can bind
directly to your datagrid.

SN
Jose wrote:
I have a datagrid with 3 columns. I have 2 tables. the question is. ¿How
obtain or show in my datagrid the column1 and column2 of my fields the my
table1 and de column3 a field of my table2?

Thanks a lot.


Jun 5 '06 #2
Sorry for my bad english Steven. Do you have a example code?

Thanks a lot
"Steven Nagy" <le*********@ho tmail.com> escribió en el mensaje
news:11******** *************@i 40g2000cwc.goog legroups.com...
Not quite sure I understand your english but if you are asking this:
"How do I show 2 columns from one table, and 1 column from another
table in one table in a datagrid?" then the answer is to
programatically create a 3rd table and add the contents of the other 2
tables as necessary. Then bind your datagrid to the 3rd new table.

But of course there are many issues to consider, such as how the data
is related between the 2 tables. Is it a 1-1 relationship? If not, then
I would question what you are trying to achieve.

Also, you can always JOIN the data before you select it from the
database, that way you will only get one table back that you can bind
directly to your datagrid.

SN
Jose wrote:
I have a datagrid with 3 columns. I have 2 tables. the question is. ¿How
obtain or show in my datagrid the column1 and column2 of my fields the my
table1 and de column3 a field of my table2?

Thanks a lot.

Jun 5 '06 #3
Example of which one? The SQL join?

Jun 6 '06 #4

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

Similar topics

4
2585
by: Mateusz [PEYN] Adamus | last post by:
Hi all! Is it possible to join for example Oracle and MS SQL tables in one dataSet and show it in one dataGrid? I'm writing in C# and using standard ADO components that come with .NET platform.
2
8875
by: Bennett Haselton | last post by:
I know how to create a DataAdapter that loads data from a data source into a table in a typed DataSet, and how to set the DataSource and DataMember properties of a DataGrid so that at run time it will load the data from that table in the DataSet. Assuming I've got two tables in the DataSet, how can I set the DataSource property of the DataGrid to be an inner join of the two tables in the DataSet? If I want the DataGrid to get data...
7
1705
by: Chris | last post by:
I'm using ASP.NET and SQL Server and this might be an obviuos question for most, but if I have a table that contains several fields that I need to relate to just one field in another table, how do I do that? I.e. Table 1 has Integer values for enteredbyID, CoordID, CustContactID Table 2 is the contacts table with Contact_ID (integer) key. Table 1 uses that field to bring back First and Last Name's. So: Table1 Table 2
0
932
by: blackg | last post by:
I need help to display images from my table in a datagrid I have two tables that are join together. Product_Image and Product my select query is : SELECT Product_Image.ProductID,Product.Product,Product.Price,Product_Image.SMimgdata FROM Product_Image INNER JOIN Product ON Product_Image.ProductID = Product.ProductID
1
1221
by: epigram | last post by:
I'd like to know if there is a best approach, in terms of using the Data Web Controls (i.e. DataGrid, DataList & Repeater), for displaying data that is the result of a query that joins two tables that have a one-to-many relationship. For instance if I perform a query on two such tables, I might expect that there would be data repeated on multiple rows from table on the one side of the relationship. What I want to do is display an HTML...
4
2267
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this dataSet updating lark when i realised that i think i am right back at square 1!!! Here's my scenario - i have a SQLDB and i retrieve all my data from that into a dataset and display this to a datagrid(WebForm). I have got this grid sorted and...
7
15437
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output the file to a folder, and then I read it back into the dataset using the dataset1.readxml. Up to this point, everything works wonderfully. The query executes, the dataset gets populated, and I get the results displayed in the datagrid.
2
1325
by: JP2006 | last post by:
I have a situation where I have 2 tables - NODES and TAGS. Nodes is the main table and contains various columns one of which is tagID. Tags contains a list of tag names and tagIDs. When a user adds an entry to the Nodes table they can specify one or more tags for the entry. Then when the form is posted if there were multiple tags in the post their tagIDs are comma seperated before being inserted in the tagID column of the Nodes table....
1
4110
by: Rob Dob | last post by:
Hi, I have both a Customer and a Orders Table, the key field is CustomerID. I also have a DataGridView that uses a BindingSource created using a join between the Customers table and the Orders table. Everything displays correctly and when I double click on a row within the datagrid I then open up a tabbed form that contains a detailed view of the bindingsource record selected ( which was created using a join ). The user at this point...
0
8361
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8701
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...
1
8466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7299
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
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
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
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.