[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

SQL: Create Assembly::

Posted on 2013-11-18
10
Medium Priority
?
677 Views
Last Modified: 2013-11-19
Hello team,
There is a DLL that I am trying to create assembly for and  call from SQL server 2008 r2 and I am getting the following message:
Msg 6544, Level 16, State 1, Line 1
CREATE ASSEMBLY for assembly 'DLLTest' failed because assembly 'DLLTest' is malformed or not a pure .NET assembly. 
Unverifiable PE Header/native stub.

Open in new window

and the assembly creating statement is :

CREATE ASSEMBLY DLLTest
AUTHORIZATION dbo
FROM 'C:\Users\jesraelo\Downloads\BergDataLink.DLL'
WITH PERMISSION_SET = unsafe

Open in new window


The following conditions are met:
> .Net 4.0
> Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)   Apr 22 2011 19:23:43   Copyright (c) Microsoft Corporation  Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
> This DLL is currently is in use in multiple VB scripts of another application.

So, to create an assembly and call the DLL at this is an issue for me IN SQL that I am trying to figure out and any assistance and help will be appreciated.
thx
0
Comment
Question by:John Esraelo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39657053
Was BergDataLink.DLL written in .NET?
0
 

Author Comment

by:John Esraelo
ID: 39657170
I believe so, I have forwarded this question to the developer just to make sure I am accurate on this.
0
 

Author Comment

by:John Esraelo
ID: 39657590
Alright, have found out that it was being done in visual foxPro  VFP ..

I guess, it is safe to say .. " my goose is cooked.. "..   now what?
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39657604
I have never worked in FoxPro. You *might* be able to write a .NET wrapper around the VFP, but I am not certain.
0
 

Author Comment

by:John Esraelo
ID: 39657650
It may be the only way. I have not done that either.

So, how would that work.  I will make a wrapper, in C# for instance, that would call the VFP.DLL and then create an assembly in SQL for the wrapper?
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39657668
Yes.
0
 

Author Comment

by:John Esraelo
ID: 39657680
that about sums it up..

now, I am going to learn how to make a DLL in c# that would accept the ARGs, creates object for the vfp dll, pass the args to VFP dll and get the results back and pass back to sql..

like we say...
marrona mia
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 39657691
Before you get too deep into it, I would suggest creating a small throw-away project that you can test with. In this way you won't spend too much time on it if it doesn't work. That is, unless your VFP project isn't that large to begin with.
0
 

Author Comment

by:John Esraelo
ID: 39657828
The VFP DLL has been created around 3 years ago and one of our applications has been using it to update the records in VFP from a VB calling process / module.  Therefore, I don't have to worry about anything on that VFP side.. the DLL is smart  enough to know which table we are updating/inserting, etc. ..
So, to make the short story longer, I can play with a table that is not used today in that vfp side and examine that by writing a small note or comments or something..
just to see if it works.

The problem is that I have been away from C# for over 5 years now.. so bit rusty..
currently looking into some info : see below
http://foxcentral.net/microsoft/netforvfpdevelopers_chapter15.htm
0
 

Author Closing Comment

by:John Esraelo
ID: 39659731
Thank you for the pointer and advice
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question