Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when I try to "Configure" a new Orchard OSOCE Web App with Sql Server in localhost (OSOE-788) #130

Closed
MarGraz opened this issue Jan 29, 2024 · 6 comments

Comments

@MarGraz
Copy link
Contributor

MarGraz commented Jan 29, 2024

Hi,

I successfully configured a new Orchard (OSOCE) web app using the SQLite database.

Now, I cloned the OSOCE repository again into a new folder, to use a new and empty database in my local SQL Server, and in the configuration, I used this connection string: Server=localhost;Database=OrchardCoreLearningPath;User Id=ImALocalhostAdmin;Password={alphanumeric-passw} but I always get the error:

"The provided connection string is invalid or the server is unreachable."

I'm able to connect to my database using SQL Server Management Studio and "localhost", I'm not using SQL Express, my user has rights to manage the database, and I'm using the standard port.
Because I started the web app with Ctrl + F5, to run the first time site configuration, I doesn't have any log in my Visual Studio Output window.

I don't understand what I'm doing wrong.

Thank you

Jira issue

@github-actions github-actions bot changed the title Error when I try to "Configure" a new Orchard OSOCE Web App with Sql Server in localhost Error when I try to "Configure" a new Orchard OSOCE Web App with Sql Server in localhost (OSOE-788) Jan 29, 2024
@MarGraz
Copy link
Contributor Author

MarGraz commented Jan 29, 2024

I also made this little Console App to check if it was able to connect, and it works.

using System.Data.SqlClient;

Console.WriteLine("Test DB localhost connection");

var connectionString = "Server=localhost;Database=OrchardCoreLearningPath;User Id=ImALocalhostAdmin;Password={alphanumeric-passw}";

try
{
    using (var connection = new SqlConnection(connectionString))
    {
        connection.Open();
        Console.WriteLine("Connection successful");
    }
}
catch (Exception ex)
{
    Console.WriteLine("An error occurred while connecting to the database, exc message:");
    Console.WriteLine(ex.Message);
}

@MarGraz
Copy link
Contributor Author

MarGraz commented Jan 29, 2024

Thanks to this issue, I discovered that adding Encrypt=false at the end of my connection string makes it work!

So the working connection string looks like: Server=localhost;Database=OrchardCoreLearningPath;User Id=ImALocalhostAdmin;Password={alphanumeric-passw};Encrypt=false

I suggest changing the example in the description to include Encrypt=false at the end of the connection string.

image

@Psichorex
Copy link
Contributor

@MarGraz That is actually coming from Orchard Core itself and not from Lombiq.TrainingDemo but we will check into this.

@Piedone
Copy link
Member

Piedone commented Jan 29, 2024

Yeah, this is coming from Orchard Core, but it would be indeed useful to document (though using Encrypt=false is only suitable for local development). Could you open an OC issue please? https://github.com/OrchardCMS/OrchardCore/issues/new/choose

@Piedone Piedone closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2024
@Psichorex
Copy link
Contributor

@Piedone
Copy link
Member

Piedone commented Jan 29, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants