<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Server, SQL Server Express, and SqlDataSource Control</title><link>http://forums.asp.net/54.aspx</link><description>All about SQL Server, SQL Server Express, MSDE, and the SqlDataSource control.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: can't register serialized assembly DLL to mssql 2005</title><link>http://forums.asp.net/thread/3247658.aspx</link><pubDate>Sat, 20 Jun 2009 15:05:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3247658</guid><dc:creator>piratejackus</dc:creator><author>piratejackus</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3247658.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3247658</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;question: on sql server i&amp;#39;m executing query with the username and password which i use to login my sql server and also this user is the owner of my database,on the other hand i&amp;#39;m logged on OS as administrator, so these are diferent accounts by nature,can that be the reason?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: can't register serialized assembly DLL to mssql 2005</title><link>http://forums.asp.net/thread/3247643.aspx</link><pubDate>Sat, 20 Jun 2009 14:49:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3247643</guid><dc:creator>piratejackus</dc:creator><author>piratejackus</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3247643.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3247643</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Hi Jian Kang,&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thank you very much for your reply and
suggestion. Sql server and assembly file are on the same machine, after
the problem that i&amp;#39;ve posted i copied my XmlSerializers to another
location (like C:\dir\PCTrigger.XmlSerializers.dll) and then i could create assembly,no error like :&lt;/p&gt;&lt;p&gt;CREATE ASSEMBLY failed because it could not open the physical file ... &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;than i thought something wrong with the path,but it didn&amp;#39;t look logical.&lt;br /&gt;&lt;/p&gt;&lt;p&gt; i&amp;#39;m going to tell what i want to do step by step and maybe it will be easier to find the error and the solution,here i go;&lt;/p&gt;&lt;p&gt;i created a trigger in visual studio for my project, code is : &lt;br /&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System;
&lt;span class="kwd"&gt;using&lt;/span&gt; System.Data;
&lt;span class="kwd"&gt;using&lt;/span&gt; System.Data.SqlClient;
&lt;span class="kwd"&gt;using&lt;/span&gt; Microsoft.SqlServer.Server;


&lt;span class="kwd"&gt;public&lt;/span&gt; partial &lt;span class="kwd"&gt;class&lt;/span&gt; Triggers
{
    &lt;span class="cmt"&gt;// Enter existing table or view for the target and uncomment the attribute line&lt;/span&gt;
    [Microsoft.SqlServer.Server.SqlTrigger (Name=&lt;span class="st"&gt;&amp;quot;AdayOyEklendi&amp;quot;&lt;/span&gt;, Target=&lt;span class="st"&gt;&amp;quot;Aday&amp;quot;&lt;/span&gt;, Event=&lt;span class="st"&gt;&amp;quot;FOR UPDATE&amp;quot;&lt;/span&gt;)]
    &lt;span class="kwd"&gt;public static void&lt;/span&gt; AdayOyEklendi()
    {
        SqlTriggerContext sct = SqlContext.TriggerContext;
        &lt;span class="kwd"&gt;if&lt;/span&gt; (sct.IsUpdatedColumn(5))
        {
            String adayId;

            SqlConnection conn = &lt;span class="kwd"&gt;new&lt;/span&gt; SqlConnection(&lt;span class="st"&gt;&amp;quot;context connection=true&amp;quot;&lt;/span&gt;);
            conn.Open();

            SqlCommand sqlCmd = conn.CreateCommand();
            sqlCmd.CommandText = &lt;span class="st"&gt;&amp;quot;SELECT * FROM &amp;quot;&lt;/span&gt; + &lt;span class="st"&gt;&amp;quot;inserted&amp;quot;&lt;/span&gt;;
            SqlDataReader reader = sqlCmd.ExecuteReader();
            reader.Read();
            adayId = (String)reader[0];
            reader.Close();

            PCTrigger.PCAdayOy.PCAdayOyTopla adayOy = &lt;span class="kwd"&gt;new&lt;/span&gt; PCTrigger.PCAdayOy.PCAdayOyTopla();
            adayOy.PCAdayOyGonder(adayId);

            conn.Close();
        }
    }
}&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;i couldn&amp;#39;t check if that code is working or not yet because of this assembly problem.than i deployed this trigger in specified database (just right click and deploy) after that in trigger properties ( visual studio ) :&lt;/p&gt;&lt;p&gt;- generates serialization assembly -&amp;gt; on&amp;nbsp;&amp;nbsp; //for the web service&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- Allow unsafe code&lt;/p&gt;&lt;p&gt;then in sql server query editor:&lt;/p&gt;&lt;p&gt;- &lt;code&gt;TRUSTWORTHY ON&lt;/code&gt;&lt;/p&gt;&lt;p&gt;no problem till here,now i have to register my PCTrigger.XmlSerializers.dll which is under C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\HedeWebService\PCTrigger\bin\Debug&amp;nbsp; but i couldn&amp;#39;t succeed you know. &lt;/p&gt;&lt;p&gt;all i have got now is my trigger created in VS under assemblies.&lt;/p&gt;&lt;p&gt;i&amp;#39;m logged in as administrator ( windows server 2003 ) and i have the permission read&amp;amp;execute of the assembly file.&lt;/p&gt;&lt;p&gt;if you have any other suggestions i&amp;#39;m here,stuck with my problem.&lt;/p&gt;&lt;p&gt;thanks again. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: can't register serialized assembly DLL to mssql 2005</title><link>http://forums.asp.net/thread/3242068.aspx</link><pubDate>Thu, 18 Jun 2009 09:34:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3242068</guid><dc:creator>Jian Kang - MSFT</dc:creator><author>Jian Kang - MSFT</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3242068.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3242068</wfw:commentRss><description>&lt;p&gt;Hi piratejackus,&lt;/p&gt;
&lt;p&gt;Please refer to the following description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When attempting to access the assembly specified in &amp;lt;client_assembly_specifier&amp;gt;, SQL Server impersonates the security context of the current Windows login. If &amp;lt;client_assembly_specifier&amp;gt; specifies a network location (UNC path), the impersonation of the current login is not carried forward to the network location because of delegation limitations. In this case, access is made using the security context of the SQL Server service account.&lt;/p&gt;
&lt;p&gt;If PERMISSION_SET = EXTERNAL_ACCESS is specified, the SQL Server login must have EXTERNAL ACCESS ASSEMBLY permission on the server. If PERMISSION_SET = UNSAFE is specified, membership in the sysadmin fixed server role is required. &lt;br /&gt;User must be the owner of any assemblies that are referenced by the assembly that are to be uploaded if the assemblies already exist in the database. To upload an assembly by using a file path, the current user must be a Windows authenticated login or a member of the sysadmin fixed server role. The Windows login of the user that executes CREATE ASSEMBLY must have read permission on the share and the files being loaded in the statement.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;br /&gt;Are the assembly file and SQL Server on the same machine? If so, please right-click the assembly file, select &lt;strong&gt;Properties&lt;/strong&gt; and check if the current Windows login has the &amp;quot;Read &amp;amp; execute&amp;quot; permissions in &lt;strong&gt;Security&lt;/strong&gt; tab.&lt;/p&gt;
&lt;p&gt;If they are not on the same machine, I think we need to share the folder on your network and grant permissions to the SQL Server service account.&lt;/p&gt;
&lt;p&gt;Related links:&lt;/p&gt;
&lt;p&gt;CREATE ASSEMBLY (Transact-SQL)&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms189524.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms189524.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Setting Up Windows Service Accounts&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms143504.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms143504.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: can't register serialized assembly DLL to mssql 2005</title><link>http://forums.asp.net/thread/3234683.aspx</link><pubDate>Mon, 15 Jun 2009 16:43:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3234683</guid><dc:creator>piratejackus</dc:creator><author>piratejackus</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3234683.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3234683</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;any idea,solution,reference would be great,i&amp;#39;m in a little hurry!&lt;br /&gt;&lt;/p&gt;</description></item><item><title>can't register serialized assembly DLL to mssql 2005</title><link>http://forums.asp.net/thread/3234069.aspx</link><pubDate>Mon, 15 Jun 2009 13:09:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3234069</guid><dc:creator>piratejackus</dc:creator><author>piratejackus</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3234069.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3234069</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;hi i have a project on .net which includes a trigger, written with c#, now after the steps to work with CLR like: &lt;/p&gt;&lt;p&gt;- generates serialization assembly -&amp;gt; on&lt;/p&gt;&lt;p&gt;- Allow unsafe code&lt;/p&gt;&lt;p&gt;- &lt;code&gt;TRUSTWORTHY ON&lt;/code&gt; &lt;/p&gt;&lt;p&gt;form the article : http://www.codeproject.com/KB/database/SQLCLR.aspx&lt;/p&gt;&lt;p&gt;i couldn&amp;#39;t succeed at last step&amp;nbsp; which is to &lt;span class="code-keyword"&gt;register&lt;/span&gt; my Serialized Assembly DLL to my database. here is what i tried:&lt;/p&gt;&lt;p&gt;&amp;nbsp;CREATE ASSEMBLY [PCTrigger.XmlSerializers] FROM &amp;#39;C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\HedeWebService\PCTrigger\bin\Debug\PCTrigger.XmlSerializers.dll&amp;#39;&lt;br /&gt;WITH PERMISSION_SET=EXTERNAL_ACCESS&lt;/p&gt;&lt;p&gt;result:&lt;/p&gt;&lt;p&gt;Msg 6501, Level 16, State 7, Line 6&lt;br /&gt;CREATE ASSEMBLY failed because it could not open the physical file &amp;#39;C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\HedeWebService\PCTrigger\bin\Debug\PCTrigger.XmlSerializers.dll&amp;#39;: 5(error not found).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;i&amp;#39;m sure that the path of the&amp;nbsp;&amp;nbsp;PCTrigger.XmlSerializers.dll is right. I already read some comments about this error but couln&amp;#39;t figure out. also i have another PCTrigger.XmlSerializers.dll file under [samepath]\obj\Debug\PCTrigger.XmlSerializers.dll , but i think i must use the one under \bin. i tried both of them and same result.&lt;/p&gt;&lt;p&gt;need help,thanks. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>