MS SQL Server connection string

Posts   
 
    
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 06-Dec-2017 16:48:05   

Hi,

was looking at the available documentation regarding the connection strings for on-premise and Azure MS SQL Server and comparing to my project I've encountered that in some connections strings I have "packet size=4096", but for the most (including test and production) I don't. Further research indicated that MS SQL Server has a default value for packet size of 4096, however, it turns out to be that ADO.NET defaults to 8000. I also noticed that one of the generated LLBLGen projects does have an App.config file that contains packet size=4096 for the connection string.

Question is: what is your take on the packet size, should it be explicitly set to 4096 or left as a default (8000)?

Thank you!

Context: MS SQL Server 2016 and Azure SQL Database

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Dec-2017 05:27:51   

Hi Findev,

Usually I don't modify this value in the connectionString, however I did it a couple of times due to optimization. I found this article, see the the final section where he talk about SQL Optimization for Azure using packet size:

https://blogs.msdn.microsoft.com/igorpag/2013/12/15/azure-network-latency-sql-server-optimization/

I hope that helps.

David Elizondo | LLBLGen Support Team
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 07-Dec-2017 10:12:00   

Hi,

thank you for your reply!

It seems that the default value of 8000 is an optimal choice. Let's see if anyone else has anything to add simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 07-Dec-2017 10:27:16   

The value in the generated connection string is chosen from the defaults for sqlserver, you can pick any value if you want. ADO.NET having a different default value is odd though.

Frans Bouma | Lead developer LLBLGen Pro
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 07-Dec-2017 10:35:17   

Hi,

yeah, that's what I thought. Though, afair, MS SQL 2000 has a value of 8000 or 8K as its default. I'll stick to ADO.NET's value for now.

Thank you!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 07-Dec-2017 11:12:43   

It's a good heads up for us too to alter the default connection string to not specify the packetsize at all simple_smile Will change that in v5.4

Frans Bouma | Lead developer LLBLGen Pro
Findev
User
Posts: 103
Joined: 08-Dec-2014
# Posted on: 07-Dec-2017 11:44:51   

That's one of the reasons why I love LLBLGen's support team simple_smile

Posts: 7
Joined: 14-Aug-2018
# Posted on: 14-Aug-2018 17:33:20   

I've been having trouble getting LLBL to read my connection string from Azure. I've created an Angular app using asp.net core 2.1. On my workstation I don't have an issue (I'm appsettings.json to store the connection string). But on Azure, the connection string never gets read, even though it's specified in the connection string configuration of the website on the Azure web portal.

I'm using LLBLGen Pro 4.2. Does anyone know why this doesn't work?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 15-Aug-2018 03:52:38   

What is the exact error you are getting?

What do you mean the Conection string is not read? Do you mean when executing a query, the ConnectionString is empty? Or it's populated correctly but can't access the database?

Which exact runtime library version are you using (check the forum guidelines thread to know to get this value)?

Thanks,

Posts: 7
Joined: 14-Aug-2018
# Posted on: 03-Oct-2018 16:51:43   

Yes,

the connection string is empty. Also, is there a way to use an Azure Managed Identity? It looks like you need access to the connection object in order to set the authentication token. I will be upgrading to version 5.4 of LLBLGen Pro.

here is an article from Microsoft:

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Oct-2018 08:37:24   

Hi Jim,

About the connection string in your configuration json, please show us your config, to know more about how are you setting it. Also, Do you use the LLblgen framework from you app, or your app access some backend/api service that use LLBLGen framework?

David Elizondo | LLBLGen Support Team
Posts: 7
Joined: 14-Aug-2018
# Posted on: 04-Oct-2018 15:10:08   

I got it working by upgrading LLBLGen Pro from 4.2 to 5.4. LLBLGen Pro 5.4 uses a different method to read from the Connections Strings section of the Azure website portal.

With regard to the Managed Identity, I've created a new thread to discuss this.

Thank you for the response.