Hi all,
I've got a problem using various CLR Trigger samples: Most samples include
expressions like the snippet below, using the System.Data.SqlServer namespac
e
to access the SqlContext:
...
using System.Data.SqlServer;
...
SqlTriggerContext stc = SqlContext.GetTriggerContext;
SqlCommand scomm = SqlContext.GetCommand();
scomm.CommandText = "SELECT * from " + "INSERTED";
SqlDataRecord sdr = scomm.ExecuteRow();
String result1 = (string)sdr[0];
...
My problem: I don't have this namespace! Can't find it in my assemblies,
it's not even included in System.Data. Is there a new way for accessing the
exact updated/inserted/deleted data which caused the trigger to execute? I'm
using the april releases of Visual Studio 2005 Beta 2 and SQL Server 2005 CT
P.
thanks in advanceThat should go for the beta newsgroup.
If you make up a new projects within Visual Studio and use the Project SQL
Server Procedure, youll find those namespace to import. if you are running
on the actual Server with Visual Studio they are installed. If you are
running on another machine you probably have to install the native client to
get this namepsaces as well as the extensions to Visual Studio 2005 to use
it.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"al" <al@.discussions.microsoft.com> schrieb im Newsbeitrag
news:2AC8B8A5-4275-4D77-801E-5D6080002287@.microsoft.com...
> Hi all,
> I've got a problem using various CLR Trigger samples: Most samples include
> expressions like the snippet below, using the System.Data.SqlServer
> namespace
> to access the SqlContext:
> ...
> using System.Data.SqlServer;
> ...
> SqlTriggerContext stc = SqlContext.GetTriggerContext;
> SqlCommand scomm = SqlContext.GetCommand();
> scomm.CommandText = "SELECT * from " + "INSERTED";
> SqlDataRecord sdr = scomm.ExecuteRow();
> String result1 = (string)sdr[0];
> ...
> My problem: I don't have this namespace! Can't find it in my assemblies,
> it's not even included in System.Data. Is there a new way for accessing
> the
> exact updated/inserted/deleted data which caused the trigger to execute?
> I'm
> using the april releases of Visual Studio 2005 Beta 2 and SQL Server 2005
> CTP.
> thanks in advance|||hi jens,
that helped to solve the problem. looking at the references i found that
this namespace is held in the sqlaccess.dll, located in the sql server
folders.
a minor problem now is a compiler warning, stating that this namespace will
soon be obsolete and the classes be relocated to the system.data.sqlclient
namespace =) currently the move seems incomplete here, so my app will be as
beta as the server ;)
greetz
al
"Jens Sü?meyer" wrote:
> That should go for the beta newsgroup.
> If you make up a new projects within Visual Studio and use the Project SQL
> Server Procedure, you′ll find those namespace to import. if you are runni
ng
> on the actual Server with Visual Studio they are installed. If you are
> running on another machine you probably have to install the native client
to
> get this namepsaces as well as the extensions to Visual Studio 2005 to use
> it.
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --|||Nice to hear that it helped.
>so my app will be as
> beta as the server
We share your experience wiht that;-)
But i think thats quite nice from the sql server team because you can plan
it to move this over. In previous version there hasnt been such a compiler
warning. :-)
Jens Suessmeyer.
http://www.sqlserver2005.de
--
"al" <al@.discussions.microsoft.com> schrieb im Newsbeitrag
news:42A09372-8CE6-44FA-991D-4896A79C680A@.microsoft.com...
> hi jens,
> that helped to solve the problem. looking at the references i found that
> this namespace is held in the sqlaccess.dll, located in the sql server
> folders.
> a minor problem now is a compiler warning, stating that this namespace
> will
> soon be obsolete and the classes be relocated to the system.data.sqlclient
> namespace =) currently the move seems incomplete here, so my app will be
> as
> beta as the server ;)
> greetz
> al
> "Jens Smeyer" wrote:
>
No comments:
Post a Comment