all groups > dotnet ado.net > january 2007 >
You're in the

dotnet ado.net

group:

run commands before SqlDataSource select?



run commands before SqlDataSource select? Sergei Shelukhin
1/31/2007 7:10:25 AM
dotnet ado.net: 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
Re: run commands before SqlDataSource select? William (Bill) Vaughn
1/31/2007 8:09:44 AM
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)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]

Re: run commands before SqlDataSource select? Sergei Shelukhin
1/31/2007 6:06:00 PM
On Jan 31, 7:09 pm, "William \(Bill\) Vaughn"
[quoted text, click to view]

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

[quoted text, click to view]
AddThis Social Bookmark Button