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