Re: Datagrid hide identical columns from a JOIN
From: Earl (brikshoe_at_newsgroups.nospam)
Date: 06/19/04
- Next message: jhs: "How to create an array of label"
- Previous message: Earl: "Re: How to allow the user to clear the calendar combo?"
- In reply to: gh0st54: "Re: Datagrid hide identical columns from a JOIN"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 19 Jun 2004 18:24:51 -0500
A couple of things I was working on today got me to thinking about this
issue. There are a couple of other issues with not retrieving your primary
keys: One is that your currencymanager will cause an exception when you try
to delete if you have not recalled your original value columns such as your
primary key. I found this out the hard way tweaking my stored procedures to
remove what I thought was "extraneous" fields. The second issue is that
failing to make a Select without an indexed field will also cause
degredation in your performance. Life is a tradeoff.
"gh0st54" <gh0st54@hotmail.com> wrote in message
news:7fa3be06.0406171210.1694fa15@posting.google.com...
> Hi
>
> Why don't you write your query to return only the fields that you need
> ?
>
> let's say you have SalesId in sales table and SalesId in salesdetails
> table
> you will join on salesid but only want the id to be displayed once.
>
> the query would be :
> select sales.[salesid],salesdetails.[column_name] from sales inner
> join salesdetails on sales.salesid = salesdetails.salesid
>
> I hope that this is what you are looking for, this way the query is
> faster (retrieves only the data that you need) and you don't have
> redundant data.
>
> gh0st54
>
> "Earl" <brikshoe@newsgroups.nospam> wrote in message
news:<#KC1PfDVEHA.3428@TK2MSFTNGP12.phx.gbl>...
> > I do not normally use JOINS in my queries these days, but I have some
> > instances where I am simply showing historical data in a grid, and it is
> > thus much more convenient to JOIN everything I need in one stored
procedure.
> > Thus I might end up with data from 3, 4 or more tables -- some with
> > identical names (the JOIN criteria).
> >
> > I know how to hide columns in a straightforward query, but how about in
a
> > JOIN query where you may have 2 or even 3 or more identical field names
(IDs
> > usually)? How do you hide, for example, the SalesID from the 2nd table
or
> > the from the 3rd table? For example, the following statement works for
the
> > first SalesID, but what about the other JOINED SalesID fields? (I've
tried
> > "SalesID1" and "Expr1", but no joy except SalesID1 seems to work on a
simple
> > query with 2 joined tables).
> >
> > ds.Tables("dtSalesPayments").Columns("SalesID").ColumnMapping =
> > MappingType.Hidden
- Next message: jhs: "How to create an array of label"
- Previous message: Earl: "Re: How to allow the user to clear the calendar combo?"
- In reply to: gh0st54: "Re: Datagrid hide identical columns from a JOIN"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|