I am developing a web application with asp.net core 2.2 and angular 7. My application is working locally but when I upload the application and SQL Server database to "1&1 Ionos" hosting server, it can't connect to the database there.

I tried with the connection string they provided in their database admin panel but it just not working.

Here is the appsettings I used in my application.

{
  "AppSettings": {
    "Secret": "bla bla bla"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "CustomPosConnection": "Provider=sqloledb;Data Source=db784146660.hosting-data.io,1433;Initial Catalog=myDbName;User Id=myUserId;Password=myPass;"
  }
}

Here "myDb" ,"myUserId","myPass" is equivalent to actual database name ,actual user id they provided and actual password that i set when creating database in the hosting server.

Please help me to connect the database in 1&1 ionos hosting server by suggesting write connection string or guiding me what else I need to do or please share if anyone has example connection string for connecting to SQL Server database from asp.net mvc or asp.net web api or asp.net core application hosted in 1&1 Ionos windows server.

1 Answers

0
Tofail Alam Tushar On

At last it worked,here is my working appsettings. Hopefully it will help you guys.

  "AppSettings": {
    "Secret": "bla bla bla"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "CustomPosConnection": "Data Source=db784146660.hosting-data.io,1433;Initial Catalog=myDb;Integrated Security=False;User Id=myUserId;Password=myPass;MultipleActiveResultSets=True;"
  }
}

Here "myDb" ,"myUserId","myPass" is equivalent to actual database name ,actual user id they provided and actual password that i set when creating database in the hosting server.