Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

ODBC with ASP.NET Core 2.2

$
0
0

Hi Folks

I'm developing an application ASP.NET Core 2.2 on .NET Framework 4.7.2 that needs access to SQL Server, MySQL, Sap Hana, and DB2 thruODBC.
I have installed the ODBC Driver on Windows, the user fill a form with credentials and send the form to validate the access

The app builds a connection string and opens a connection to validate the access. The problem is that only work with SQL Server when I try with MySQL, Oracle or other I got the error Message "[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".

The code I use to validate the connections string is in a separate .NET Framework Library and when I use it in a console app it works and when consuming it in ASP.NET CoreProject don't

using (OdbcConnection connection = new OdbcConnection("Driver={MySQL ODBC 5.1 Driver};server=localhost;Port=3306;Database=sakila;Uid=user;pwd=Password;Option=3;"))
{
  try
  {
     connection.Open();
  }
  catch (Exception e)
{
// return error message
} }

Any Ideas how to solve it


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>