Home All Groups Group Topic Archive Search About

run commands before SqlDataSource select?

Author
31 Jan 2007 3:10 PM
Sergei Shelukhin
Hi. Is there any way to run sql commands on the same connection that
SqlDataSource uses to select data before the select? Apaprt from
trying to build a multi-command CommandText.
Overriding the class would be ok but I can't find the way to do it

Author
31 Jan 2007 4:09 PM
William (Bill) Vaughn
Sure. Pick up the ConnectionString from the Settings and us it to run your
SqlCommand.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

Show quote
"Sergei Shelukhin" <realg***@gmail.com> wrote in message
news:1170256213.324734.280040@q2g2000cwa.googlegroups.com...
> Hi. Is there any way to run sql commands on the same connection that
> SqlDataSource uses to select data before the select? Apaprt from
> trying to build a multi-command CommandText.
> Overriding the class would be ok but I can't find the way to do it
>
Author
1 Feb 2007 2:06 AM
Sergei Shelukhin
On Jan 31, 7:09 pm, "William \(Bill\) Vaughn"
<billvaRemoveT***@nwlink.com> wrote:

No, it's not what I mean. What I mean is on the same connection
instance/in the same session before the select command is issued.
I have to access MySQL thru ODBC and due to db setup I need to issue a
bunch of  set something-charset commands right after I open a
connection so that the data would be retrieved normally. However I
can't find the way to do it with GridView cause it opens its own
connection internally...

Show quote
> Sure. Pick up the ConnectionString from the Settings and us it to run your
> SqlCommand.
>

AddThis Social Bookmark Button