F #: Connecting to Azure SQL db?

I want to connect to my Azure db and work with it from a .fsx file.

Method given for C #:

SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
                builder.DataSource = "your_server.database.windows.net"; 
                builder.UserID = "your_user";            
                builder.Password = "your_password";     
                builder.InitialCatalog = "your_database";

using (SqlConnection connection = new SqlConnection(builder.ConnectionString))
...

      

Is there a better way to do this in F #, or should I just try extrapolating from C # to F #? I know that after creating the string, we can use type providers like the SqlProgrammabilityProvider.

Basically looking for an F # guide on connecting to an azure SQL server similar to this C # one:

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-connect-query-dotnet-core

Microsoft is clearly producing a lot of C # content that doesn't have an F # equivalent :(

+3


source to share


1 answer


I am using this great library for database access in F #:

https://fsprojects.github.io/SQLProvider/core/general.html



Look specifically at the MS SQL section to connect to the MS SQL database.

+2


source







All Articles