joining three fields into one???

  • Thread starter Thread starter VMI
  • Start date Start date
V

VMI

I'm currently using the dataAdapter.Fill method to fill my dataset with data
from an Access DB. My dataset will contain a table with three fields from
Access. In my datagrid (for user interaction), I need to join the data from
these 3 cols into a temporary datacolumn. I can't add this additional
column in the Access table because I'll be duplicating data so I was
thinking of creating a datacolumn in runtime and looping through the filled
datatable. Is there any way to fill this temporary datacolumn without having
to loop through the datatable?

Any suggestions?
 
You are on the right track. Create a new DataColumn, add it to the column's
collection and just set its Expression property to the concatenated value of
the three other columns. If you look in the article below, I actually
concenate three fields together so you can just substitute your column names
for mine.
http://www.knowdotnet.com/articles/dataviews1.html
 
Just a thought,

If you use SQL against the Access db, you can do it on the backend. I know
very little about Access, but I have build SQL queries (in Access) that have
done what you want.

This might be a preferred solution since you won't have to do any manual
manipulation of the grid in code.

The downside of this approach is that this is a read only solution (the
combination is done at the Access level). If you want the column to be
automatically updated when changes are made to the other fields, then you
will have to make a column that is computed.
 
Thanks, it worked. I thought I was going to have to create a separate column
in Access.
I read your profile and I noticed that you've also worked with macromedia
Flash. I'm a free-lance Windows software consultant and I have a friend
that's interested in creating some sites that include Flash content in them.
He's thinking of hiring a company that works with web design
(www.itacon.com) and they've made pages such as:
http://www.cesaravargas.com/home.html
http://www.clavellassociates.com/Clavell_1024.html
http://www.ewirelesspr.com/

so I want to learn how to build Flash content similar to the one in those
pages . Do you recommend any books or sites that'll help with making this
type of Flash? I assume that these sites aren't really so complicated, so
I'd prefer not to have to program in Actionscript (I already have a bunch of
programming languages in my head, I don't think I can handle another one).
Or would you suggest using another tool (maybe Swish)?

Thanks for your input.
 
Back
Top