<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Runtime Error while connecting HANA DB from VS Code in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/runtime-error-while-connecting-hana-db-from-vs-code/qaa-p/12635885#M4740066</link>
    <description>&lt;P&gt;Thank you Michael for your responce.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 16:21:21 GMT</pubDate>
    <dc:creator>sumedhahire</dc:creator>
    <dc:date>2022-12-12T16:21:21Z</dc:date>
    <item>
      <title>Runtime Error while connecting HANA DB from VS Code</title>
      <link>https://community.sap.com/t5/technology-q-a/runtime-error-while-connecting-hana-db-from-vs-code/qaq-p/12635883</link>
      <description>&lt;P&gt;Dear Folks,&lt;/P&gt;
  &lt;P&gt;I am trying to connect SAP HANA instance from VS Code using .net 7.0.&lt;/P&gt;
  &lt;P&gt;I have installed .net7 SDK and SP &lt;/P&gt;
  &lt;P&gt;I am getting below error while creating HanaConnection object.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;Exception has occurred: CLR/System.TypeInitializationException&lt;BR /&gt;An exception of type 'System.TypeInitializationException' occurred in Sap.Data.Hana.Core.v2.1.dll but was not handled in user code: 'The type initializer for 'Sap.Data.Hana.HanaConnection' threw an exception.'&lt;BR /&gt; Inner exceptions found, see $exception in variables window for more details.&lt;BR /&gt; Innermost exception 	 System.IO.FileNotFoundException : Cannot find a matching libadonetHDB.dll with version 2.11.14 - check the location in the HDBDOTNETCORE or PATH / LD_LIBRARY_PATH / DYLD_LIBRARY_PATH environment variables&lt;BR /&gt;(Process) HDBDOTNETCORE=C:\Program Files\sap\hdbclient\dotnetcore&lt;BR /&gt;(Machine) HDBDOTNETCORE=C:\Program Files\sap\hdbclient\dotnetcore&lt;BR /&gt;Searched paths and results: &lt;BR /&gt;C:\Program Files\sap\hdbclient\dotnetcore\libadonetHDB.dll : 2.14.22 : False&lt;BR /&gt;C:\Program Files\sap\hdbclient\dotnetcore\libadonetHDB.dll : 2.14.22 : False&lt;BR /&gt;C:\Program Files\SAP\hdbclient\ado.net\libadonetHDB.dll : 2.14.22 : False&lt;BR /&gt;   at Sap.Data.Hana.HanaUnmanagedDll.SearchNativeDlls()&lt;BR /&gt;   at Sap.Data.Hana.HanaUnmanagedDll..ctor()&lt;BR /&gt;   at Sap.Data.Hana.HanaUnmanagedDll.get_Instance()&lt;BR /&gt;   at Sap.Data.Hana.HanaConnection..cctor()&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;You may refer below code for reference.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;using System.Diagnostics;&lt;BR /&gt;using Microsoft.AspNetCore.Mvc;&lt;BR /&gt;using TestCode.Models;&lt;BR /&gt;using Sap.Data.Hana;&lt;BR /&gt;namespace TestCode.Controllers;&lt;BR /&gt;public class HomeController : Controlle{&lt;BR /&gt;    private readonly ILogger&amp;lt;HomeController&amp;gt; _logger;&lt;BR /&gt;    public HomeController(ILogger&amp;lt;HomeController&amp;gt; logger){&lt;BR /&gt;        _logger = logger;&lt;BR /&gt;        HanaConnection conn = new HanaConnection();&lt;BR /&gt;        conn.ConnectionString =  "connectionstring";&lt;BR /&gt;        conn.Open();conn.Close();&lt;BR /&gt;    }&lt;BR /&gt;    public IActionResult Index()&lt;BR /&gt;    {&lt;BR /&gt;        return View();&lt;BR /&gt;    }&lt;BR /&gt;    public IActionResult Privacy()&lt;BR /&gt;    {&lt;BR /&gt;        return View();&lt;BR /&gt;    }&lt;BR /&gt;    [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]&lt;BR /&gt;    public IActionResult Error()&lt;BR /&gt;    {&lt;BR /&gt;        return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });&lt;BR /&gt;    }&lt;BR /&gt;}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2022 09:03:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/runtime-error-while-connecting-hana-db-from-vs-code/qaq-p/12635883</guid>
      <dc:creator>sumedhahire</dc:creator>
      <dc:date>2022-11-23T09:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error while connecting HANA DB from VS Code</title>
      <link>https://community.sap.com/t5/technology-q-a/runtime-error-while-connecting-hana-db-from-vs-code/qaa-p/12635884#M4740065</link>
      <description>&lt;P&gt;This is a simple HANA client version mismatch, but it's not your fault. It can be solved in different ways, see this for a detailed explanation - &lt;A href="https://stackoverflow.com/questions/45233832/ado-net-provider-for-sap-hana-version-mismatch-issue"&gt;https://stackoverflow.com/questions/45233832/ado-net-provider-for-sap-hana-version-mismatch-issue&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 10:40:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/runtime-error-while-connecting-hana-db-from-vs-code/qaa-p/12635884#M4740065</guid>
      <dc:creator>michael_eaton3</dc:creator>
      <dc:date>2022-11-23T10:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error while connecting HANA DB from VS Code</title>
      <link>https://community.sap.com/t5/technology-q-a/runtime-error-while-connecting-hana-db-from-vs-code/qaa-p/12635885#M4740066</link>
      <description>&lt;P&gt;Thank you Michael for your responce.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 16:21:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/runtime-error-while-connecting-hana-db-from-vs-code/qaa-p/12635885#M4740066</guid>
      <dc:creator>sumedhahire</dc:creator>
      <dc:date>2022-12-12T16:21:21Z</dc:date>
    </item>
  </channel>
</rss>

