VS.NET 2005 Beta 2 managed stored proc creation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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