473,326 Members | 2,805 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,326 software developers and data experts.

how do I add columns from other tables to a DataGrid?

I have one main table which references several other lookup tables, like
think of on the main table for example a category_id column with a categories
table which maps that id to a string value.

I used the .NET IDE to make my dataGrid and all those data adapters and so
on and it works great with update too, if I add a row and call
adapter.Update() it works fine. But right now I am only selected from the
main table so it's showing all these ID fields which I dont want shown, I
want to see the string value those ids are mapped to in other tables, so i
need some joins in the SQL.

How do I do this?

One thing I tried was going into the dataset designer page where it shows me
my datasources and I clicked configure on my main table, and I editted it's
query so that i does a join with the sub tables. This worked for loading the
DataGrid but all of a sudden the Update method on my adapter disappeared! So
I was no longer able to add data!

What happened and what is the right way to do this so that I can still
insert data into my main table
Oct 20 '06 #1
2 1207
Hi MrNobody,

I have written a fairly detailed answer to your question on my new
blog:

http://clintonforbes.blogspot.com/20...ogramming.html

:but you aren't going to like it... Don't take it the wrong way. I am
genuinely trying to help.

Oct 20 '06 #2
Oh neat, I have been included to your blog :)

But you know, I completely agree with you! I am by nature a typer when it
comes to making apps, not a drag-n-dropper.

The problem is I am a Java developer and I mostly write web applications, I
am little experience writing Windows GUI client applications especially with
..NET, which I only use when I do my "hobby programming" at home.

What I need to do is do a simple SQL join to get a bunch of results from a
database and display it in a Table view. The first thing I did was start to
write code, and it soon because apparant that if there was any good low-level
database access in .NET I simply was not finding it. It seemed like to get a
simple parameterized SQL statement set up (which in Java I'd just create a
Prepared Statement and just start calling setObject() on the various
'wildcard' positions) I'd have to setup this abstract DataAdapter and create
al these bizarre Parameter objects and it was getting to be way too
complicated for the simple task I wanted to do.

Then I started looking at DataGrid control and it looked like such a hassle
to use it without using DataSets and DataTables - all the .NET data controls
and then that's when I stumpled upon this little arrow on the upper right of
the control in the design view and I went to investigate it and was presented
with an option to set a DataSource. So I started stumbling into this wild
world of visual DataSource configuration and just when it looked like it was
working out pretty good going on a tabe by table basis it all fell apart when
I wanted to use multiple table sources...
Oct 21 '06 #3

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

Similar topics

3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
2
by: Wing | last post by:
Hi all, I am using Microsoft Visual Studio .NET 2003 to program my code. I have following question. I am trying to adding a few bound columns which from a dataset that containing 2 tables to...
4
by: | last post by:
I have a datagrid with a template column that has a hyperlink and a label. The hyperlink text is bound to Title from my dataset and the label text is bound to Author in the dataset. The grid...
7
by: Luis Esteban Valencia | last post by:
I have this i need to show the datagrid with columns of 2 datatables Dim myadap As New SqlDataAdapter myconn.Open() myadap.TableMappings().Add("Table", "vistaUsuarios")
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
1
by: Steve | last post by:
I have a DataGrid connected to a DataSet (read in from an XML file). The documentation that I've read suggests that I attach a DataGridTableStyle to the DataGrid to allow for additional...
4
by: Jeff | last post by:
I am stuck on trying to generate two columns headers for a datagrid on form load. I can use a datatable as the datasource and get the results I want, but I want to set different column widths and...
1
by: whidbey | last post by:
Hello frnds, I have created a datagrid with the following code...... <asp:datagrid id="DataGrid1" BackColor="#ccccff" BorderColor="black" Width="750" Runat="server" AutoGenerateColumns="False"...
2
by: Scott | last post by:
I am trying to sort a datagrid which contains 5 checkbox columns. All other columns sort properly except these 5 checkbox columns which dont sort at all. I am using ASP.NET 1.1 and this code is...
0
by: Glenn Rosenthal | last post by:
I have a Web page with a datagrid for display search results. The first column contains a check box and a hidden field, and are defined with the datagrid. <asp:DataGrid...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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: 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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.