Rabu, 04 Februari 2009

CLR using Threadpool and "context connection=true"
Arun Mayol posted at 15-Mar-08 06:08
Hi

I have a DLL deployed in SQL2005 which uses Thread pool. Since DLL exists in DB we can directly access it using context connection = true.

In my case the following works fine, if i execute the same out side Threadpool

SqlCommand cmd = new SqlCommand("select 1...", connection);
SqlContext.Pipe.ExecuteAndSend(cmd);

When i execute inside threadpool, either by passing opened connection object, or tried to open connection to "context connection = true" i am getting following error.

System.InvalidOperationException: The requested operation requires a Sql Server execution thread. The current thread was started by user code or other non-Sql Server engine code. at Microsoft.SqlServer.Server.SmiContextFactory.GetCurrentContext() at Microsoft.SqlServer.Server.SqlContext.get_CurrentContext() at Microsoft.SqlServer.Server.SqlContext.get_Pipe() at hiqidty4.hiqidty4.Identify_Search(Object identifyin)

Let me know if i am missing any more here

Thanks in advance




source :http://www.eggheadcafe.com

-------------------------------------------------------

Trik Gambar Bergerak

Trik Gambar-dimouse

Trik hapus pwd mysql

Trik insertin to db

Trik jadi root dilinux

Trik jam-distatus-bar

Trik Koneksi-ke database

Trik Koneksi-msql-php

Trik lihat-database-mysql

Trik membahas-fungsi-else

Trik member-area

Valentineday

vb2008 with control

vb2008 with control properties

vb2008 with oriented programming

VB.NET Solution files

VB.NET Code myclass

Virus protection

VisualStudio aGood Partnership