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

G

Guest

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
 
G

Guest

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top