Endpoint Error DbConnectionStringBuilder netstandard

  • 56Views
  • Last Post 5 weeks ago
0
votes
don schlichting posted this 30 June 2020

Hello,

Im creating my first aspx end point page following https://docs.skyvia.com/connect/sql-endpoints/ado.net-provider.html   But I'm always getting two errors and two warnings (pic attached)   .  NuGet install was fine, no errors.

 Errors Below,  Web config at very botom.

Thanks!!

Don

 

Severity Code Description Project File Line Suppression State

Error CS0012 The type 'DbConnectionStringBuilder' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 1_OpenOrders.aspx C:\Dons\Exceed3\OpenOrders.aspx.cs 26 Active

 

Severity Code Description Project File Line Suppression State

Error CS1061 'SkyviaConnectConnectionStringBuilder' does not contain a definition for 'ConnectionString' and no accessible extension method 'ConnectionString' accepting a first argument of type 'SkyviaConnectConnectionStringBuilder' could be found (are you missing a using directive or an assembly reference?) 1_OpenOrders.aspx C:\Dons\Exceed3\OpenOrders.aspx.cs 26 Active

 

Severity Code Description Project File Line Suppression State

WarningAssuming assembly reference 'Devart.Data, Version=5.0.2393.0, Culture=neutral, PublicKeyToken=09af7300eec23701' matches 'Devart.Data, Version=5.0.2458.0, Culture=neutral, PublicKeyToken=09af7300eec23701', you may need to supply runtime policy

 

Severity Code Description Project File Line Suppression State

Warning CS1702 Assuming assembly reference 'Devart.Data, Version=5.0.2393.0, Culture=neutral, PublicKeyToken=09af7300eec23701' used by 'Devart.Data.SqlShim' matches identity 'Devart.Data, Version=5.0.2458.0, Culture=neutral, PublicKeyToken=09af7300eec23701' of 'Devart.Data', you may need to supply runtime policy 1_OpenOrders.aspx C:\Dons\Exceed3\OpenOrders.aspx.cs 26 Active

 

WEB CONFIG

---

<?xml version="1.0" encoding="utf-8"?>

<!--

  For more information on how to configure your ASP.NET application, please visit

  https://go.microsoft.com/fwlink/?LinkId=169433

  -->

<configuration>

  <appSettings>

    <add key="dbKits2" value="server=gtinfo5; database=Kits2; uid=WebApps5; pwd=NowBake20160527!" />

  

    <add key="dbP21" value="server=p21sql; database=p21; uid=WebApps5; pwd=NowBake20160527!" />

 

  </appSettings>

  <connectionStrings>

    

  </connectionStrings>

  <system.web>

    <compilation debug="true" targetFramework="4.7">

      <assemblies>

        <add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

        <add assembly="System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

      </assemblies>

    </compilation>

    <httpRuntime targetFramework="4.7" />

    <customErrors mode="Off" />

  </system.web>

<system.webServer>

    <handlers>

      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />

      <remove name="OPTIONSVerbHandler" />

      <remove name="TRACEVerbHandler" />

      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

    </handlers>

  </system.webServer><system.data> 

    <DbProviderFactories> 

      <add name="dotConnect for SkyviaConnect" invariant="Devart.Data.SkyviaConnect" description="Devart dotConnect for SkyviaConnect" type="Devart.Data.SkyviaConnect.SkyviaConnect ProviderFactory, Devart.Data.SkyviaConnect, Version=Version=1.0.14.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />

    </DbProviderFactories> 

  </system.data>

  <runtime>

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

      <dependentAssembly>

        <assemblyIdentity name="Devart.Data" publicKeyToken="09af7300eec23701" culture="neutral" />

        <bindingRedirect oldVersion="0.0.0.0-5.0.2458.0" newVersion="5.0.2458.0" />

      </dependentAssembly>

    </assemblyBinding>

  </runtime>

</configuration>

___

 

Thanks!

Don 

Attached Files

Order By: Standard | Newest | Votes
0
votes
Dmitriy Muzurov posted this 01 July 2020

Hello Don,

Thank you for submitting a ticket with us.

The endpoint from our documentation is an example and can't be used for connection.

This endpoint is specified in your code. Please change it to your actual SQL endpoint, created in Skyvia Connect, include actual login credentials and try again.

We are looking forward to hearing from you, should you have any questions.

0
votes
don schlichting posted this 01 July 2020

Yea, i know. the error has nothing to do with the values.  The error is saying ConnectionString is not valid for connectionStringBuilder

 

 

Severity Code Description Project File Line Suppression State

Error CS1061 'SkyviaConnectConnectionStringBuilder' does not contain a definition for 'ConnectionString' and no accessible extension method 'ConnectionString' accepting a first argument of type 'SkyviaConnectConnectionStringBuilder' could be found (are you missing a using directive or an assembly reference?) 1_OpenOrders.aspx C:\Dons\Exceed3\OpenOrders.aspx.cs 26 Active

 

0
votes
don schlichting posted this 01 July 2020

All the DLLs and using statemens seem correct.  Pic attached

0
votes
Dmitriy Muzurov posted this 02 July 2020

Dear Don,

Thank you for details.

Please create a new test project in your Visual Studio: File > New > Project > ASP.NET Web Application (.NET Framework) C#, choose Empty.

Add a new *.aspx page and place our code from the tutorial to the Page_Load event handler, add "using Devart.Data.SkyviaConnect;" in the beginning of the code file.

Then, navigate to Tools > NuGet Package Manager > Package Manager Console and execute:

Install-Package Devart.Data.SkyviaConnect

After this, your project should be compiled successfully.

0
votes
don schlichting posted this 07 July 2020

Hi there, Thanks.  So IDK. On the ADO example page there are two connection expamples.  One just perfect for me.  The other gives error:  

Could not load type 'Devart.Common.GlobalComponentsCache' from assembly 'Devart.Data, Version=5.0.2404.0, Culture=neutral, PublicKeyToken=09af7300eec23701

Here is the one that works:

 protected void Conn1Works()

        {

            SkyviaConnectConnectionStringBuilder connectionStringBuilder = new SkyviaConnectConnectionStringBuilder();

            connectionStringBuilder.EndpointUrl = "https://connect.skyvia.com/l0l5pw72";

            connectionStringBuilder.User = "adsf";

            connectionStringBuilder.Password = "asdfdsaf$";

 

            SkyviaConnectConnection connection = new SkyviaConnectConnection(connectionStringBuilder.ConnectionString);

            connection.Open();

            connection.Close();

        }

 

Here is the one that fails. it fails even if the command text is commented out.  Its the connection.Open() throwing the error:

   protected void Conn2Fails()

        {

            const string connectionString = "Endpoint Url=https://connect.skyvia.com/l0l5pw72;User=adsf;Password=adsfdf$";

            const string sql = "exec p21.dbo.zsky_OpenOrders1";

            using (SkyviaConnectConnection connection = new SkyviaConnectConnection(connectionString))

            {

                connection.Open();

                using (SkyviaConnectCommand command = connection.CreateCommand())

                {

                    command.CommandText = sql;

                    Console.WriteLine(command.ExecuteNonQuery());

                }

            }

 

        }

 

In my web config are a coule of Skyvia not created automatically.  I'm just including them in caes they are relevlant:

  <DbProviderFactories> 

      <add name="dotConnect for SkyviaConnect" invariant="Devart.Data.SkyviaConnect" description="Devart dotConnect for SkyviaConnect" type="Devart.Data.SkyviaConnect.SkyviaConnect ProviderFactory, Devart.Data.SkyviaConnect, Version=1.0.14.0, Culture=neutral, PublicKeyToken=09af7300eec23701"/>

 

    </DbProviderFactories> 

 

 <dependentAssembly>

        <assemblyIdentity name="Devart.Data" publicKeyToken="09af7300eec23701" culture="neutral"/>

        <bindingRedirect oldVersion="0.0.0.0-5.0.2404.0" newVersion="5.0.2404.0"/>

      </dependentAssembly>

    </assemblyBinding>

 

Thanks for the help!!

Don

0
votes
Dmitriy Muzurov posted this 09 July 2020

Dear Don,

Thank you for getting back to us.

In Visual Studio, right-click on your project in Solution Explorer > Properties and make sure that the "Target framework" property of your project is set to .NET Framework (not .NET Core).

If this doesn't help, create a small test project for reproducing the error, upload it to some file exchange server (e.g.: www.dropbox.com) and provide us with the link to it.

We are looking forward to hearing from you.

0
votes
don schlichting posted this 10 July 2020

Hi there,

 

Here is the link  https://pccweb-my.sharepoint.com/:up/dons/EZ7njwCeSSlAg6N3AP7KyrcBEpSy65m2j-mC3P_A8-OF1Q?e=dWs0dr

Thanks!!

 

Have a great weekend.

Don

 

0
votes
don schlichting posted this 10 July 2020

https://pccweb-my.sharepoint.com/:up/dons/EZ7njwCeSSlAg6N3AP7KyrcBEpSy65m2j-mC3P_A8-OF1Q?e=dWs0dr

 

Same link but noticed a goofy char in the first post

0
votes
don schlichting posted this 10 July 2020

not sure whats up with this input box. when i llook in the post i see :u and a sad face p/

the link should be :up

 

Thanks

Don

 

0
votes
don schlichting posted this 10 July 2020

colon slash

0
votes
Dmitriy Muzurov posted this 14 July 2020

Dear Don,

Thank you for the link.

We managed to reproduce the issue with your project and created a ticket for our development team to investigate this.

Once there are any details, we will let you know.

0
votes
don schlichting posted this 14 July 2020

Very good.  Thank you.  Glad i wasnt just being daft!

0
votes
Dmitriy Muzurov posted this 5 weeks ago

Dear Don,

It turned out that our package NuGet is broken. While our developers are fixing it, we can recommend removing it from your project and using an installed provider.

You can download it on the page with your SQL endpoint, on Overview tab in Skyvia SQL API Clients section. It is called ADO.NET installation:

Once a NuGet package is fixed, we will let you know.

Close