Generate Expressions in a dataset

J

John Sheppard

Hello there,

I was wondering if anyone knows if there is an easy way to import
expressions into my typed dataset from the original view/sql statement

For example if I drag a view from the server explorer onto my dataset I
would like it to import not just the caculated field but also the expression
that creates the field.

I think that an ORM mapper would probably do this for me but unfortunatly I
am stuck with datasets :(

Any ideas would be much appreciated, thank you
John Sheppard
 
R

Roger Tranchez

Hello,

Have you tried to edit the text in the selectcommand for the created
tableadapter, and copy from the definition for the view in sql server and
paste on the selectcommand text ?

Bye,
 
J

John Sheppard

Thanks Roger,

Yes I could do that, I just thought perhaps there might be a better way...

The expression field isnt standard sql or anything either which makes things
kind of difficult :(

I think I was perhaps hoping too much that I could automate it....
 
R

Roger Tranchez

In fact, if you have a view in sql server you can import it directly, doing
drag'n drop from server explorer to the design surface for your xsd file. It
seems obvious that if the select statement is not into a view, user function
or stored procedure, it is not possible to directly import it (you are trying
to import a "piece of text", so what could be expected ?!)

Bye,
 
J

John Sheppard

When I tried it it did not import the expression from the view..it just
creates the field like its any other field...I thought perhaps it might try
and import the underlying expression as well...

It's double the work and error prone to make views that calculate then have
to duplicate any expression into the dataset manually...seems silly...

Thanks roger
John
 

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