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 - VB.NET: dynamically change SqlDataSource SelectCommand and re-exec

Reply
 
Old 01-29-2009   #1 (permalink)
Mike J.


 
 

VB.NET: dynamically change SqlDataSource SelectCommand and re-exec

I want to know if it's possible to dynamically change the query,
SelectCommand, of a SqlDataSource and then re-execute the query. Then reload
the GridView with different data.

My situation is a page needs two links above a GridView. One link to export
the current location's data (already in the GridView) and the second link to
export the data from all locations (requiring a new query and refresh of the
GridView).

Is this possible in VB.NET/ASP.NET? It already is being done using another
programing application, but we required to stop using the other one soon.

Thanks!

My System SpecsSystem Spec
Old 01-30-2009   #2 (permalink)
Cor Ligthert[MVP]


 
 

Re: VB.NET: dynamically change SqlDataSource SelectCommand and re-exec

Mike,

It depends if you are creating your program mainly by code or by drag and
drop.

As you use code, then there is not any problem to fulfil what you ask, it is
even quiet easy.

(Don't forget to clear your datasources as the datatable or whatever).

Are you using drag and drop, then there are some protected areas, which have
to be overcome, and which cost mostly more trouble then that you did more in
code.

Cor

"Mike J." <Mike J.@xxxxxx> wrote in message
newsE39D28A-BE6E-466C-9F19-0407B7359CF3@xxxxxx
Quote:

>I want to know if it's possible to dynamically change the query,
> SelectCommand, of a SqlDataSource and then re-execute the query. Then
> reload
> the GridView with different data.
>
> My situation is a page needs two links above a GridView. One link to
> export
> the current location's data (already in the GridView) and the second link
> to
> export the data from all locations (requiring a new query and refresh of
> the
> GridView).
>
> Is this possible in VB.NET/ASP.NET? It already is being done using
> another
> programing application, but we required to stop using the other one soon.
>
> Thanks!
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Sqldatasource Update .NET General
How to reset the SelectCommand of a SqlDataSource on the client(JavaScript)? .NET General
GridView not Updating Through SqlDataSource .NET General
newbie question on SqlDataSource object .NET General
Can't exec a program from another Vista security


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