I am developing a custom package in Visual Studio 2010. This package can connect to oracle DB (read, write some data). For this functionality I need to reference Oracle.Data.Access.dll (64bit) and Oracle client installed. I found it under the C:\oracle\odp.net\bin\4\ folder. When I develop a console application everything works fine. But when I try to validate and save my extension in package builder I get this error:
Cannot create assembly from file C:...\Oracle.Data.Access.dll. The file is not a valid .NET assembly.
I've found the solution. Just using system.data.oracleclient assembly for this purpose. It is working perfectly with tibco package builder and tibco player.
Related
I am trying to connect to an Informix database and need to add this reference to my project:
using IBM.Data.Informix;
What package in package manager console do I need to be able to use this library?
Thanks in advance!
To connect to an Informix database from .NET you have to options:
The Informix .NET Provider
The IBM Data Server .NET Provider
Have a look at this tech note which describes both .NET provider:
https://www.ibm.com/developerworks/data/library/techarticle/dm-1007dsnetids/
Both will work with Informix. The first one is the 'native' .NET provider included with CSDK (CSDK or ClientSDK is the product that includes all the Informix drivers (ODBC/OLEDB/.NET) etc.
At the moment the only way to get the drivers installed is with a stand alone package (Informix CSDK). There are some plans to get them in NuGet, so you would be able to get the drivers directly from the Visual Studio package manager without anything to install.
The second option, 'IBM Data Server .Net Provider' is included in the 'IBM Data Server' which is an 'common' set of drivers from IBM. It will allow you to connect to either DB2 or Informix (through a DRDA connection)
You can get the IBM Data Server Driver Package from the IBM website, or download the .NET drivers (and required libraries) directly from NuGet:
https://www.nuget.org/packages/IBM.Data.DB.Provider/
PM> Install-Package IBM.Data.DB.Provider
The .NET assembly class is called 'IBM.Data.DB2.dll' There used to be a 'replacement' dll named the same as the Informix CSDK one (IBM.Data.Informix.dll) but is now deprecated. Even with that name ;) it is fully supported against Informix databases.
There are some differences between the .NET providers (e.g. connection string) so if you are going to use the 'DB2' one, I suggest to check the documentation at:
https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.swg.im.dbclient.adonet.doc/doc/c0024472.html
There is also a new beta .NET provider for the new '.NET Core' supporting both Windows and Linux platforms. If you are going to develop for .NET Core, this is the one you want
https://www.nuget.org/packages/IBM.Data.DB2.Core/1.0.0.100
PM> Install-Package IBM.Data.DB2.Core
I have just started to create an ASP.NET Core Web API Project. I am not much aware of "ASP.NET Core .NET Standard Library".
I am creating this application using Visual Studio 2017 RC and in the application, I have taken a project of type Class Library (.NET Standard) at repository layer.
Following is the screenshot for the same:
Now from repository Layer I want to connect to the database. I have created a variable
IDbConnection con;
Now I am trying to add reference of System.Data but I am unable to add any reference because when I am opening the add reference window then I am getting the following message:
No Framework assemblies were found on the machine.
How can I connect to database using .NET Core Class Library(.NET Standard)?
.NET Standard Class libraries don't work by directly referencing a DLL, because with .NET Core there is no guarantee the framework will be installed on the system and .NET Core applications can also run as self-contained applications which ship the framework libraries with the application and do not require a runtime to be installed before.
You have to use the NuGet package manager (or project.json or *.csproj in VS2017) to add dependencies. For SQLServer you need to add the System.Data.SqlClient package (link) if you want to directly communicate with the Database (i.e. w/o an ORM).
Above answer (Tseng) may have been valid in 2016 and .NET Standard 1.4, but in the meantime, Microsoft did remove some showstoppers, allowing access to SQL Server from a .NET Standard 2.1 library. Mind the old System.Data.SqlClient will not link, so you (really!) have to refer EF6 via NuGet and change some using.
Create a .NET Standard Class library and put version on 2.1
Install Entity framework (this contains the lower level libs)
In using, refer to System.Data and to Microsoft.Data
Using are:
using System.Data
using Microsoft.Data.SqlClient
Now, "legacy" classes like DataSet, SqlConnection and SqlClient will become available.
It is not completely compatible (yet) There are some things that are not available in .NET standard 2.1, such as enumerating available SQL servers on the LAN. This was done with SqlDataSourceEnumerator which is a class in System.Data I cannot locate in Microsoft.Data.
NOTE: I tested successfully with a .Net Core 3.1 console application. A Standard lib configured as above can be called from .NET Core and connect to the database without issues. You cannot use a .NET Framework caller.
I just configured the code on my machine. (VS2013 Premium) and I am not able to run any of the test case because of one following error :
"Warning: Test Run deployment issue: The assembly or module
'Oracle.ManagedDataAccessDTC' directly or indirectly referenced by the
test container
'e:\cs\qa_automation\all_team_current_automation\international\lda_automation\bin\debug\lda_automation.dll' was not found."
It is an Oracle version issue or what ? Can anybody guide me?
Mentioned dll is part of Oracle Data Access Components (ODAC). You need to install Oracle client software called 32-bit Oracle Data Access Components (ODAC)
with Oracle Developer Tools for Visual Studio
This should add Oracle support components for Visual Studio and solve your issue.
I'm developing an interface between my application (built with Visual Studio 2003 and the .NET Framework 1.1) and a Sybase database. I installed the Adaptive Server to store the database. The problem arises when I tried to reference the neeeded dll to my project, I have two dll's (Sybase.AdoNet2.AseClient.dll and Sybase.AdoNet4.AseClient.dll) that can't be added, and searching the web I see there is a dll called "Sybase.Data.AseClient.dll" but donĀ“t know where to get it from. Help!!
It depends which version of Sybase do you have.
The drivers can be installed along with Sybase client installation.
You should have to dll files:
sybdrvadoXX.dll (where XX is a number)
Sybase.Data.AseClient or Sybase.AdoNet2.AseClient
The first one just throw in the bin directory.
The second one add to the references.
Good luck :)
I am following the article Using SQLite Embedded Database with Entity Framework and Linq-to-SQL, and have tried installing the SQLite provider, first using the System.Data.SQLite NuGet package, and then by installing the provider via the Setups for 32-bit Windows (.NET /Framework 4.0) installer package (for v1.0.79). After both installs, and a system restart, I still see no SQLite Database File provider in the Add Connection dialogue from Server Explorer.
I can proceed by manually creating a connection string and using external tools to create my SQLite database file, but I still would like to know what is wrong why I do not have the advertised design time support for SQLite despite having installed the latest provider. What could be wrong here?
Ensure the data tools for visual studio were installed correctly as per:
http://www.basarat.com/2010/05/sqlite-for-visual-studio-2010.html
There are various fixes listed, making sure there weren't older tools installed first, etc.
I'm going to give it a try, but the article may help you out.