Generate Expressions in a dataset

Generate Expressions in a dataset

am 16.04.2008 01:40:34 von Gabe Garza

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

RE: Generate Expressions in a dataset

am 16.04.2008 10:01:00 von run1789

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,

--
Roger Tranchez
MCTS
..NET 2005 and DB developer


"John Sheppard" wrote:

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

Re: Generate Expressions in a dataset

am 17.04.2008 02:12:07 von Gabe Garza

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

"Roger Tranchez" wrote in message
news:B8E1C261-3491-4D04-8FE3-FCA7924E852D@microsoft.com...
> 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,
>
> --
> Roger Tranchez
> MCTS
> .NET 2005 and DB developer
>
>
> "John Sheppard" wrote:
>
>> 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
>>
>>
>>

Re: Generate Expressions in a dataset

am 17.04.2008 09:43:02 von run1789

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,

--
Roger Tranchez
MCTS
..NET 2005 and DB developer


"John Sheppard" wrote:

> 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....
>
> "Roger Tranchez" wrote in message
> news:B8E1C261-3491-4D04-8FE3-FCA7924E852D@microsoft.com...
> > 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,
> >
> > --
> > Roger Tranchez
> > MCTS
> > .NET 2005 and DB developer
> >
> >
> > "John Sheppard" wrote:
> >
> >> 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
> >>
> >>
> >>
>
>
>

Re: Generate Expressions in a dataset

am 18.04.2008 03:29:13 von Gabe Garza

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

"Roger Tranchez" wrote in message
news:2F54E738-6309-486E-AB74-559C50F5A59A@microsoft.com...
> 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,
>
> --
> Roger Tranchez
> MCTS
> .NET 2005 and DB developer
>
>
> "John Sheppard" wrote:
>
>> 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....
>>
>> "Roger Tranchez" wrote in message
>> news:B8E1C261-3491-4D04-8FE3-FCA7924E852D@microsoft.com...
>> > 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,
>> >
>> > --
>> > Roger Tranchez
>> > MCTS
>> > .NET 2005 and DB developer
>> >
>> >
>> > "John Sheppard" wrote:
>> >
>> >> 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
>> >>
>> >>
>> >>
>>
>>
>>