Showing posts with label reading. Show all posts
Showing posts with label reading. Show all posts

Saturday, February 25, 2012

problem creating assembly using other assemblies

Hi,

I have developed a Stored procedure to output text to a text file, after doing a lot of reading here.
I want to be able to output data to a Postgres database, to be used for web mapping. I have referenced an Assembly Npgsql.dll so I can send updates to the postgres database when my ms sql database is updated. However, after building my class library, when I try to CREATE ASSEMBLY in sql server 2005 express, it sends out a message:
Msg 10301, Level 16, State 1, Line 1
Assembly 'ClassLibrary1' references assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(error not found)). Please load the referenced assembly into the current database and retry your request.
The error seems to be in the Npgsql.dll assembly, can anybody please shed some light on this.
I tried to load the system.drawing assembly, and can do so in Unrestricted mode. It then spits out the same problem for System.Windows.Forms.dll.
I am still very new to all of this so any help would be appreciated.
Cheers,
Jatz91.

I got around this problem.

I used CREATE ASSEMBLY with PERMISSION_SET=UNSAFE and put the Microsoft.NET Framework Assemblies in the same folder where my built assembly was.

When I used CREATE ASSEMBLY, a warning was spat out for each assembly saying:

Warning: The Microsoft .Net frameworks assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment.

So now I run my CLR in UNSAFE mode

Cheers

Monday, February 20, 2012

Problem connecting to SQL-Server

Hello and thanks for reading.
This is my environment:
3 CITRIX Servers with anonymous users to login
Win2K Server with MS-SQL2K and the databases
Users logging in from the first server can connect to the sql-server, the
users logging in on the two other servers can´t. I think the reason is that
the anoymous users from the latter 2 servers have no right to connect to the
DB-Server. I think it is a problem with the windows users security, not with
the SQL-server´s. But I can´t figure out how to change this.
Any idea?
Thank you!
BerndI could tell you how to do this but then I would have to kill you...
But seriously
You will need to add some sort of security in your SQL Server database.
This can be in two forms.
Either Server 2000 security or SQL Security.
So the question is this.
When your CITRIX Servers users log into the Windows server do they have a particualr domain, or are they assigned any sort of proxy ID for use on the Server 2000 ?
If the answer is yes then this domain or ID can be used is SQL Server Secrurity.
If the answer is no then you will need to create each user (or CITRIX Servers application) individually within SQL Server security, assigning it User ID and passwords.
If you have any further questions then please do not hesitate to ask.
Peter Nolan
MCP
>--Original Message--
>Hello and thanks for reading.
>This is my environment:
>3 CITRIX Servers with anonymous users to login
>Win2K Server with MS-SQL2K and the databases
>Users logging in from the first server can connect to the sql-server, the
>users logging in on the two other servers can=B4t. I think the reason is that
>the anoymous users from the latter 2 servers have no right to connect to the
>DB-Server. I think it is a problem with the windows users security, not with
>the SQL-server=B4s. But I can=B4t figure out how to change this.
>Any idea?
>Thank you!
>Bernd
>
>.
>|||Maybe I was not clear enough:
1) My application connects to the MS-SQL instance using SQL security.
User/Password inside SQL-Sever and does not exist outside.
2) MS-SQL Instance is located on Server DB
3) CITRIX Terminalserver is located on SERVER CT1, CT2, CT3
4) Users log on CT1 - CT3 using windows anonymous users and start the
application (wich tries to connect to the db using the SQL-user)
5) On CT1 this succeeds, CT2-CT3 this fails.
Cheers
Bernd
---
This can be in two forms.
Either Server 2000 security or SQL Security.
So the question is this.
When your CITRIX Servers users log into the Windows server
do they have a particualr domain, or are they assigned any
sort of proxy ID for use on the Server 2000 ?
If the answer is yes then this domain or ID can be used is
SQL Server Secrurity.
If the answer is no then you will need to create each user
(or CITRIX Servers application) individually within SQL
Server security, assigning it User ID and passwords.
If you have any further questions then please do not
hesitate to ask.
Peter Nolan
MCP
>--Original Message--
>Hello and thanks for reading.
>This is my environment:
>3 CITRIX Servers with anonymous users to login
>Win2K Server with MS-SQL2K and the databases
>Users logging in from the first server can connect to the
sql-server, the
>users logging in on the two other servers can´t. I think
the reason is that
>the anoymous users from the latter 2 servers have no
right to connect to the
>DB-Server. I think it is a problem with the windows users
security, not with
>the SQL-server´s. But I can´t figure out how to change
this.
>Any idea?
>Thank you!
>Bernd
>
>.
>