Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Using sequlizer issues

karmanov's Avatar

karmanov

15 Feb, 2017 09:59 AM

Hi,
I've created an application on AppHarbor and installed sequelizer add-on.

I've formed connection string according this article. (first code snippet) without using App.Setting and adding connectionString to web.config, just in code.
Now, what code is needed to open connection to my database stored on AppHarbor SqlServer? I'm new in database, so any advice will be appreciated. My application I try to get to work is https://appharbor.com/applications/shop-21/

p.s. wonder if you could give simple sample project illustrating how to achieve my goal

  1. Support Staff 1 Posted by rune on 16 Feb, 2017 06:12 AM

    rune's Avatar

    Hi,

    Happy to help! I'm not sure exactly what the issue is though -- can you describe the errors you're seeing in more detail, ideally including the relevant exceptions returned from your application? I took a look at the application you referenced and found a few SQLite-related errors indicating that the client/SQL provider isn't configured correctly - are those maybe related to the issue you're seeing or are you referring to something else?

    There's a basic application using EntityFramework here in case that helps -- but generally speaking you shouldn't need to configure the connection to AppHarbor's shared SQL server instances any differently than you would configure a local instance of SQL Server.

    Best,
    Rune

  2. 2 Posted by karmanov on 17 Feb, 2017 10:58 PM

    karmanov's Avatar

    Thank you for answer. It is possible that I did a mistake with configuring SQL provider correctly.
    My last try is https://appharbor.com/applications/testapp-674. It works on my pc, but after deploy I have this:

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]

    Can you look at my source and told me what I am doing wrong?

  3. Support Staff 3 Posted by rune on 19 Feb, 2017 02:42 AM

    rune's Avatar

    Hi,

    Based on the error message alone it seems like it's trying to use SQL Server Express LocalDB instance. SQL Server isn't installed on the worker servers and your application doesn't have any SQL Server instances associated so I'd assume this is the reason you're able to run it locally and not on AppHarbor.

    Try and install one of the SQL server add-ons and set the connection string alias to the name of your connection string from your web.config.

    Best,
    Rune

  4. 4 Posted by karmanov on 19 Feb, 2017 09:00 AM

    karmanov's Avatar

    Totally forgot to install the SQL server. It works now, thank you. But i stay on using SQLSERVER_URI application parameter to create connection string and apply it to active instance of DbContext class instead of write connection string in web.config. Is it ok?

  5. karmanov closed this discussion on 19 Feb, 2017 09:00 AM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac