Tuesday, March 20, 2012
Custom SQL library ?
Does anyone know of a library for .Net that would allow to execute SQL
statements and scripts against SQL server and Oracle databases. The
general purpose will be to execute DDL statements, create procedures
tables etc, currently we use osql and sqlplus invocations with
parameters from .Net environment.
The ADO .Net has some limitations and I am unable to use it.
Tom.I guess it depends on what your reasons are for not being able to use
ADO.Net. I imagine that any other library would connect in a very similar
way.
"Tom" <mutobo@.interia.pl> wrote in message
news:1149579157.093610.119170@.i40g2000cwc.googlegroups.com...
> Hi All
> Does anyone know of a library for .Net that would allow to execute SQL
> statements and scripts against SQL server and Oracle databases. The
> general purpose will be to execute DDL statements, create procedures
> tables etc, currently we use osql and sqlplus invocations with
> parameters from .Net environment.
> The ADO .Net has some limitations and I am unable to use it.
> Tom.
>|||Tom
Well, you are going to use SELLECT/UPDATE/DELETE statements ONLY , I mean
not to use stored procedures.
BL passes "SELECT <> FROM Table" on DAL and it sends the statement to the
database
"Tom" <mutobo@.interia.pl> wrote in message
news:1149579157.093610.119170@.i40g2000cwc.googlegroups.com...
> Hi All
> Does anyone know of a library for .Net that would allow to execute SQL
> statements and scripts against SQL server and Oracle databases. The
> general purpose will be to execute DDL statements, create procedures
> tables etc, currently we use osql and sqlplus invocations with
> parameters from .Net environment.
> The ADO .Net has some limitations and I am unable to use it.
> Tom.
>|||Well as I said I will mainly use the library to transport DDL
statements. I would like to create procedures (oracle packages), tables
etc. This is not possible in ADO.NET due to for example script length
limitations ( 2000 chars, any table definition can be longer ) and for
oracle there is no support for ';' character as a statement
separator. I would like to take a script file that for example creates
a table with all references and successfully run it to the database ?
Tom.
Thursday, March 8, 2012
Custom library Use
When I had used SQL2K5 Sept. CTP there was an issue using custom .net framework 2.0 library. I had to register the library in GAC + had to copy the dll into .Net framework 2.0 folder structure. I understand why we need to copy the dll on the development box so we can build packages, but why do I need to copy the dll in framework folder for production environment. Should GAC registration be enough?
If this is a feature, what's the purpose of registering the dll in GAC if it requires it to be in folder hierarchy. Especially in .net framework 2.0 so that the reference dialog box can display the component.
The question is if I have custom dll how do I deploy it so that it works with the package? How can I use the same dll in development environment without having to copy it in .net framework folder?
You need to put the DLL in the Framework folder if you are calling it from a script task or script component. You only have to do this on your development workstation.More info here: http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2341.aspx
-Jamie|||
The DLL should be in Frameworks folder at runtime only if the script task's or component's PreCompile option is set to FALSE. In this case the script is compiled at runtime, and the dependency needs to be in the Frameworks folder due to VSA limitations.
In default case when PreCompile is TRUE, the DLL only needs to be deployed to GAC at runtime.
|||That was it. I found a script task that did not have PreCompile set to True.Thank you.
Friday, February 24, 2012
Custom code assembly with config file
Hi!
My report has a reference to an assembly of a class library I did. This class library has a config file, classLibrary.dll.config, where I set some parameters, one of these being the "initial path" to the project's folder(for example, project folder is myProject, and you would use the initial path to say it's in c:/projects/tests). When I preview the report everything works fine, but when I publish it I get this error:
Absolute path information is required.
I guess it's not reading the dll.config file, so it can't see the initial path value and concatenate it with the project's folder. I'm supposing this because at first, I forgot to copy the dll.config file to the Microsoft Visual Studio 8/Common7/IDE/PrivateAssemblies folder and I got the same error when trying to preview the report. Copying it to this folder solved the problem. So I think I'm not placing the dll.config file in the rigth folder (I'm copying it to Microsoft SQL Server/MSSQL/ReportServer/bin). If I don't use the config file, I mean, if I put the absolute path directly in the code, everything works, but this is just something I can't do! Can anyone help me?
Thank you!
what happens if you copy config file to reportserver/bin and give 'everyone' read access to it?|||Hi!
It still can't see the config file... My class library has two classes, Class A uses Class B. Can I use only Class A ddl or should I put both dll files in the rssrvpolicy.config?
Thank you!
|||You should put both|||Hi!
Still have the problem... When I try to preview the assembly location using Assembly.GetExecutingAssembly().Location, it shows me the rigth path to the dll file. When I try to see it from the published report, I get #Erro on the textbox. Is this write?
Thank you!
|||Take a look at the logfiles at:
\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\LogFiles
Usually they can help you..
Hint:
Stop Reporting Services and WWW-Publishing, delete all old Logfiles, and restart the services. So you can easily find the right logfiles..
Hi!
Thanks for the post, I'll take a look on the log files... But I'm wondering if there is a simpler way to do what I'm trying to do. I'm doing all this because I can't have in my code an absolute path to a xml file configurable by the user. I know that, if it was a web page, I could use Server.MapPath("file.xml") to made it relative to the project path. Can't I do something like this with a Class Library? Or is the config file the only solution?
Thank you!