Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Generate Expressions in a dataset

Reply
 
Old 04-15-2008   #1 (permalink)
John Sheppard


 
 

Generate Expressions in a dataset

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



My System SpecsSystem Spec
Old 04-16-2008   #2 (permalink)
Roger Tranchez


 
 

RE: Generate Expressions in a dataset

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

> 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
>
>
>
My System SpecsSystem Spec
Old 04-16-2008   #3 (permalink)
John Sheppard


 
 

Re: Generate Expressions in a dataset

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" <run1789@xxxxxx> wrote in message
news:B8E1C261-3491-4D04-8FE3-FCA7924E852D@xxxxxx
Quote:

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

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

My System SpecsSystem Spec
Old 04-17-2008   #4 (permalink)
Roger Tranchez


 
 

Re: Generate Expressions in a dataset

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

> 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" <run1789@xxxxxx> wrote in message
> news:B8E1C261-3491-4D04-8FE3-FCA7924E852D@xxxxxx
Quote:

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

> >> 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
> >>
> >>
> >>
>
>
>
My System SpecsSystem Spec
Old 04-17-2008   #5 (permalink)
John Sheppard


 
 

Re: Generate Expressions in a dataset

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" <run1789@xxxxxx> wrote in message
news:2F54E738-6309-486E-AB74-559C50F5A59A@xxxxxx
Quote:

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

>> 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" <run1789@xxxxxx> wrote in message
>> news:B8E1C261-3491-4D04-8FE3-FCA7924E852D@xxxxxx
Quote:

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

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
$Variables into Regular expressions ?! help PowerShell
Vista and Expressions web and browser Browsers & Mail
New lines in regular expressions PowerShell
How to work with regular expressions PowerShell
Regular expressions PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46