Showing posts with label array. Show all posts
Showing posts with label array. Show all posts

Thursday, March 29, 2012

Error access Custom Assembly in Deploying

Please,

i did a class in C# that return a array of bytes... in preview mode (design) i can see this return, but when i use Deploy (Server) i can′t see.

I already put the lines on of security in file srrsvpolicy.config and copy the file dll to folder, however i cant see the result.

Anybody help me?

I′m using:

- SQL 2005
- dll no strong name

Thanks

Jota

Assuming you have put the right security settings and deployed the assembly to the Report Server bin folder, your method may need additional CAS security rights depending on what your code is trying to do, as explained in more details here. What I suggest you do is put a breakpoint in your assembly code, attach to the ASP.NET process, and run the report so you can debug your code and see where the exception is thrown.

Monday, March 26, 2012

error 823, severity 24, state2

The following messages seems happen every two weeks. it may cause by hardwar
e
error, but HP Array Utility hasn't detected any error. Any ideas, does it
make sense to move database to the local hard drive?
Error: 823, Severity: 24, State: 2
I/O error (bad page ID) detected during read at offset 0x0000016d7fa000 in
file 'E:\SQLDATA\MSSQL\Data\SUN5DB_data.mdf'.
Data:Words
0000: 00000337 00000018 00000009 00550053
0010: 0044004e 00540041 00310041 00070000
0020: 00530000 004e0055 00440035 00000042
SQL Enterprise 2000 Server, Windows 2000 Enterprise Server, Compaq MSA 1000,
the database is on SAN disks.Sounds like you may have some corruption in the database.
Try running the DBCC CHECKCATALOG and see what you get back. BOL has some
great suggestions on the usage as well as some others like DBCC CHECKTABLE
and DBCC CHECKxxxxxx
Rick Sawtell
MCT, MCSD, MCDBA
"Joshua" <Joshua@.discussions.microsoft.com> wrote in message
news:A1DF380C-CB99-4125-A713-7E14303C6125@.microsoft.com...
> The following messages seems happen every two weeks. it may cause by
> hardware
> error, but HP Array Utility hasn't detected any error. Any ideas, does it
> make sense to move database to the local hard drive?
> Error: 823, Severity: 24, State: 2
> I/O error (bad page ID) detected during read at offset 0x0000016d7fa000 in
> file 'E:\SQLDATA\MSSQL\Data\SUN5DB_data.mdf'.
> Data:Words
> 0000: 00000337 00000018 00000009 00550053
> 0010: 0044004e 00540041 00310041 00070000
> 0020: 00530000 004e0055 00440035 00000042
> SQL Enterprise 2000 Server, Windows 2000 Enterprise Server, Compaq MSA
> 1000,
> the database is on SAN disks.

error 823, severity 24, state2

The following messages seems happen every two weeks. it may cause by hardware
error, but HP Array Utility hasn't detected any error. Any ideas, does it
make sense to move database to the local hard drive?
Error: 823, Severity: 24, State: 2
I/O error (bad page ID) detected during read at offset 0x0000016d7fa000 in
file 'E:\SQLDATA\MSSQL\Data\SUN5DB_data.mdf'.
Data:Words
0000: 00000337 00000018 00000009 00550053
0010: 0044004e 00540041 00310041 00070000
0020: 00530000 004e0055 00440035 00000042
SQL Enterprise 2000 Server, Windows 2000 Enterprise Server, Compaq MSA 1000,
the database is on SAN disks.
Sounds like you may have some corruption in the database.
Try running the DBCC CHECKCATALOG and see what you get back. BOL has some
great suggestions on the usage as well as some others like DBCC CHECKTABLE
and DBCC CHECKxxxxxx
Rick Sawtell
MCT, MCSD, MCDBA
"Joshua" <Joshua@.discussions.microsoft.com> wrote in message
news:A1DF380C-CB99-4125-A713-7E14303C6125@.microsoft.com...
> The following messages seems happen every two weeks. it may cause by
> hardware
> error, but HP Array Utility hasn't detected any error. Any ideas, does it
> make sense to move database to the local hard drive?
> Error: 823, Severity: 24, State: 2
> I/O error (bad page ID) detected during read at offset 0x0000016d7fa000 in
> file 'E:\SQLDATA\MSSQL\Data\SUN5DB_data.mdf'.
> Data:Words
> 0000: 00000337 00000018 00000009 00550053
> 0010: 0044004e 00540041 00310041 00070000
> 0020: 00530000 004e0055 00440035 00000042
> SQL Enterprise 2000 Server, Windows 2000 Enterprise Server, Compaq MSA
> 1000,
> the database is on SAN disks.
|||Generally the first thing you do is look up the error number in Books On
line... Here is the info from BOL
Error 823
Severity Level 24
Message Text
I/O error %ls detected during %S_MSG at offset %#016I64x in file '%ls'.
Explanation
Microsoft SQL ServerT encountered an I/O error on a read or write request
made to a device. This error usually indicates disk problems. However,
additional kernel messages in the error log, recorded before error 823,
should indicate which device is involved.
Action
Check the accessibility and condition of the device in question.
Run hardware diagnostics and correct problems, if possible.
Restore damaged files from the latest database backup. Restoring from a
database backup should always be considered the primary means of fixing a
damaged database.
If you don't have a backup or if the errors detected are very isolated, the
repair functionality of DBCC CHECKDB may be useful. However, using DBCC
CHECKDB can be more time consuming than restoring the damaged files from a
backup, and you may not be able to recover all your data .
Caution If running DBCC CHECKDB with one of the repair clauses does not
correct the problem or if you are unsure how this process may affect your
data, contact your primary support provider.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Joshua" <Joshua@.discussions.microsoft.com> wrote in message
news:A1DF380C-CB99-4125-A713-7E14303C6125@.microsoft.com...
> The following messages seems happen every two weeks. it may cause by
hardware
> error, but HP Array Utility hasn't detected any error. Any ideas, does it
> make sense to move database to the local hard drive?
> Error: 823, Severity: 24, State: 2
> I/O error (bad page ID) detected during read at offset 0x0000016d7fa000 in
> file 'E:\SQLDATA\MSSQL\Data\SUN5DB_data.mdf'.
> Data:Words
> 0000: 00000337 00000018 00000009 00550053
> 0010: 0044004e 00540041 00310041 00070000
> 0020: 00530000 004e0055 00440035 00000042
> SQL Enterprise 2000 Server, Windows 2000 Enterprise Server, Compaq MSA
1000,
> the database is on SAN disks.
begin 666 caution.gif
M1TE&.#EA# `+`/<``````#,``&8``)D``,P``/\````S`#,S`&8S`)DS`,PS
M`/\S``!F`#-F`&9F`)EF`,QF`/]F``"9`#.9`&:9`)F9`,R9`/^9``#,`#/,
M`&;,`)G,`,S,`/_,``#_`#/_`&;_`)G_`,S_`/__````,S,`,V8`,YD`,\P`
M,_\`,P`S,S,S,V8S,YDS,\PS,_\S,P!F,S-F,V9F,YEF,\QF,_]F,P"9,S.9
M,V:9,YF9,\R9,_^9,P#,,S/,,V;,,YG,,\S,,__,,P#_,S/_,V;_,YG_,\S_
M,___,P``9C,`9F8`9ID`9LP`9O\`9@.`S9C,S9F8S9IDS9LPS9 O\S9@.!F9C-F
M9F9F9IEF9LQF9O]F9@."99C.99F:99IF99LR99O^99@.#,9C/,9F;,9IG,9LS,
M9O_,9@.#_9C/_9F;_9IG_9LS_9O__9@.``F3,`F68`F9D`F<P`F?\`F0`SF3,S
MF68SF9DSF<PSF?\SF0!FF3-FF69FF9EFF<QFF?]FF0"9F3.9F6:9F9F9F<R9
MF?^9F0#,F3/,F6;,F9G,F<S,F?_,F0#_F3/_F6;_F9G_F<S_F?__F0``S#,`
MS&8`S)D`S,P`S/\`S `SS#,SS&8SS)DSS,PSS/\SS !FS#-FS&9FS)EFS,QF
MS/]FS "9S#.9S&:9S)F9S,R9S/^9S #,S#/,S&;,S)G,S,S,S/_,S #_S#/_
MS&;_S)G_S,S_S/__S ``_S,`_V8`_YD`_\P`__\`_P`S_S,S_V8S_YDS_\PS
M__\S_P!F_S-F_V9F_YEF_\QF__]F_P"9_S.9_V:9_YF9_\R9__^9_P#,_S/,
M_V;,_YG,_\S,___,_P#__S/__V;__YG__\S______P``````````````````
M````````````````````````````````````````````````` ```````````
M````````````````````````````````````````````````` ```````````
M`````````````````````"'Y! $``*P`+ `````,``L`0 @.B`%D)'$BPH,&#
;K HH1)AP(4*%!1A"9$A1X,2'#BMBC#@.P( `[
`
end

error 823, severity 24, state2

The following messages seems happen every two weeks. it may cause by hardware
error, but HP Array Utility hasn't detected any error. Any ideas, does it
make sense to move database to the local hard drive?
Error: 823, Severity: 24, State: 2
I/O error (bad page ID) detected during read at offset 0x0000016d7fa000 in
file 'E:\SQLDATA\MSSQL\Data\SUN5DB_data.mdf'.
Data:Words
0000: 00000337 00000018 00000009 00550053
0010: 0044004e 00540041 00310041 00070000
0020: 00530000 004e0055 00440035 00000042
SQL Enterprise 2000 Server, Windows 2000 Enterprise Server, Compaq MSA 1000,
the database is on SAN disks.Sounds like you may have some corruption in the database.
Try running the DBCC CHECKCATALOG and see what you get back. BOL has some
great suggestions on the usage as well as some others like DBCC CHECKTABLE
and DBCC CHECKxxxxxx
Rick Sawtell
MCT, MCSD, MCDBA
"Joshua" <Joshua@.discussions.microsoft.com> wrote in message
news:A1DF380C-CB99-4125-A713-7E14303C6125@.microsoft.com...
> The following messages seems happen every two weeks. it may cause by
> hardware
> error, but HP Array Utility hasn't detected any error. Any ideas, does it
> make sense to move database to the local hard drive?
> Error: 823, Severity: 24, State: 2
> I/O error (bad page ID) detected during read at offset 0x0000016d7fa000 in
> file 'E:\SQLDATA\MSSQL\Data\SUN5DB_data.mdf'.
> Data:Words
> 0000: 00000337 00000018 00000009 00550053
> 0010: 0044004e 00540041 00310041 00070000
> 0020: 00530000 004e0055 00440035 00000042
> SQL Enterprise 2000 Server, Windows 2000 Enterprise Server, Compaq MSA
> 1000,
> the database is on SAN disks.

Monday, March 19, 2012

Error 6522 Trying to Run Assembly from database

Hi,
I am attempting to load an assembly that has been stored in a table as a byte array. I have created a c# class called AssemblyLoader that takes in 2 parameters, the assembly name and the parameters for the assembly (just a query string).
From this it returns the assembly byte array using a simple sql statement within the class using the assembly name to select the assembly bytes to return from the database.

The returned byte array of the assembly is loaded using:
Assembly assembly = Assembly.Load(assemblyBytes);


This seems to be the line that SQL Server 2005 is erroring on. Do I need to add some extra assemblies to the database and if so which ones.

Error:
Msg 6522, Level 16, State 1, Procedure ClientInterface, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'ClientInterface':
System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at Reflector.runQuery(String query, String parameter)
Thanks for your help.

SQL Server does not allow you to load an assembly from file, nor byte array. You can only call Assembly.Load(), in which case the assembly has to be catalogued in the database.

Niels|||Cheers Niels
I am using Assembly.Load with the Full name of the assembly and it works fine.
Thanks|||So does this mean that you can create a Class Library project, compile it and then simply place the assembly inside SQL 2005 to get access to external objects?
Just to confirm, you are not limited to placing the output of SQL Server Project inside SQL Server 2005?

Thank you,

Lubomir|||Thats pretty much all I have done. I have created 3 seperate Class Library Projects that each extend a common interface so that they all have the method

public static string execute(string data)

and are compiled and added to the database. They are loaded depending on the query I pass in and they go off and get data from different interfaces ie, LDAP, HTTP SOAP etc... and return me a simple string.

N
|||Lubomir,
A SQL CLR Project is just a project type in VS, which makes it easier for the developer to create and deploy assemblies to SQL Server. Under the cover the SQL CLR Project is just calling CREATE ASSEMBLY ... etc, in order to deploy.

Niels

Error 6522 Trying to Run Assembly from database

Hi,
I am attempting to load an assembly that has been stored in a table as a byte array. I have created a c# class called AssemblyLoader that takes in 2 parameters, the assembly name and the parameters for the assembly (just a query string).
From this it returns the assembly byte array using a simple sql statement within the class using the assembly name to select the assembly bytes to return from the database.

The returned byte array of the assembly is loaded using:
Assembly assembly = Assembly.Load(assemblyBytes);


This seems to be the line that SQL Server 2005 is erroring on. Do I need to add some extra assemblies to the database and if so which ones.

Error:
Msg 6522, Level 16, State 1, Procedure ClientInterface, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'ClientInterface':
System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at Reflector.runQuery(String query, String parameter)
Thanks for your help.

SQL Server does not allow you to load an assembly from file, nor byte array. You can only call Assembly.Load(), in which case the assembly has to be catalogued in the database.

Niels
|||Cheers Niels
I am using Assembly.Load with the Full name of the assembly and it works fine.
Thanks
|||So does this mean that you can create a Class Library project, compile it and then simply place the assembly inside SQL 2005 to get access to external objects?
Just to confirm, you are not limited to placing the output of SQL Server Project inside SQL Server 2005?

Thank you,

Lubomir|||Thats pretty much all I have done. I have created 3 seperate Class Library Projects that each extend a common interface so that they all have the method

public static string execute(string data)

and are compiled and added to the database. They are loaded depending on the query I pass in and they go off and get data from different interfaces ie, LDAP, HTTP SOAP etc... and return me a simple string.

N
|||Lubomir,
A SQL CLR Project is just a project type in VS, which makes it easier for the developer to create and deploy assemblies to SQL Server. Under the cover the SQL CLR Project is just calling CREATE ASSEMBLY ... etc, in order to deploy.

Niels