Add expression column to a view

  • Thread starter Thread starter DCraig
  • Start date Start date
D

DCraig

I'm having problems creating an expression column in a table inside a
dataset because of multiple parent rows. I know the syntax is correct
because I've done it several other times successfully. I'm thinking I need
to split the table to get rid of the duplicates and am looking at two
options: one is to create two tables then create and expression column in
each, but then I thought that I could create two views on the one table, but
that leaves the problem of creating the column. Normally one would create
the expression column on the table then create the views, but that's where
I'm having the problem.

So the question is, can I create an expression column in a view? The
documentation I have doesn't say either way,

Thanks in advance,

David Craig
ABC-CLIO
 
Hi,

You can create column only on table and not for DataView (which is really a
view on the table).
 
DCraig:

You'll notice that the View concept is kind of where the abstraction with
real databases is different than the rest of the system.Data objects. Ok, A
dataset corresponds to a database, a DataTable corresponds to a given table
in that database. A Database is comprised or 0 or more tables, a Dataset is
made of 0 or more datatables.. However, Views in most db's can run off a
proc, a function, joined tables or whatever. DataViews in System.Data
aren't, they are based only one One DataTable.. They don't have a Rows
collection or a Columns collection and they derive their info from the table
they are based on. You can create an expression column on the table, but if
it's not in the table, it won't be in the view.

HTH,

Bill
 
Back
Top