Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

VS.NET 2005 Beta 2 managed stored proc creation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
StephenBKennedy - 05 May 2005 20:55 GMT
In Beta 1, the Microsoft.Data.SqlServer.SqlContext.GetCommand static/shared
method allowed for the creation of a SqlCommand with a pre-assigned
Connection property denoting a SqlConnection associated with the DB where the
assembly was installed.
Does anyone know the replacement for this method (or how to get a
SqlConnection or SqlCommand object populated with the appropriate info
related to the hosting DB in Beta 2?)

Thanks in advance

Stephen
StephenBKennedy - 06 May 2005 16:08 GMT
I found out the answer to my own question:

SqlConnection conn = new SqlConnection("context connection=true");
SqlCommand cmd = new SqlCommand("select * from authors", conn);

replaces

SqlCommand cmd = SqlContext.CreateCommand();
cmd.CommandText = "select * from authors";

Found it here:
http://staff.develop.com/bobb/weblog/

Thanks.

> In Beta 1, the Microsoft.Data.SqlServer.SqlContext.GetCommand static/shared
> method allowed for the creation of a SqlCommand with a pre-assigned
[quoted text clipped - 7 lines]
>
> Stephen

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.