Setting up SQL Connection String for DotNetNuke in shared host environment - connection-string

I'm setting up a DotNetNuke application on a shared hosting environment and I'm really new to the ASP.Net world. In a shared environment, do I have a web.config file? or does my host have to set up my connection string for me?
I have access to the IIS through my host's control panel.
Any help is greatly appreciated.
I've visited the DotNetNuke Wiki and it's given me guidance on the connection string itself, but I can't seem to locate the web.config file.

DotNetNuke will setup the connection string for you during the install process.
When you select "SQL Server Database", it will ask you for:
authentication method (Windows Auth, SQL Authentication),
location of the server (Example: IP Address)
Database Name (Empty Database needs to be pre-created)
Username and Password (if you selected SQL Authentication)
Before proceeding to the next step, the installer will make sure it can access the database given the information that you provided.
If it succeeds, and the next step proceeds, that means the connection string was already setup for you.
So where do you get your information for steps 1 - 4?
Basically, your hosting provider should have this information for you. There will be a preferred authentication method for step 1 above. It is probably SQL Authentication.
Your host should tell you where your SQL Server is located -- they should give you a hostname or IP Address for the SQL Server.
For step 3, There should be some method for you to create databases -- probably using a web interface or, if you're lucky, SSMS.
Finally, they should have provided you sa login credentials for Step 4 -- but it's best if you can create your own credentials and provide them access to only your DNN database for this step.

In a shared host environment you will have your own web.config file, with most hosts you should be able to at least access it via ftp if not some fancier control panel.
In a shared hosting environment some web.config settings will be dictated by the host and ignored in your own web.config. For example the host will likely force your site to run under medium trust no matter how you configure your own web.config.

Related

Getting Error 18451: Only, or Error: 17810 when making multiple calls to database

I'm new to SQL Server. I was a postgres user before. I installed the default SQL Server on my local machine and I'm trying to get an old react with node js application of mine working with a SQL Server. When ever my frontend makes more than 1 call to the backend, if my SQL Server has admin privileges it throws
Error: 17810: Could not connect because the maximum number of '1' dedicated administrator connections already exists.
If not, it throws:
Error 18451: Only administrators may connect at this time.
I checked my database configs and it's set to MULTI_USERS, so I don't understand why I can't login without admin privileges. Can someone help me with this? I wasn't able to find anything online.
My NodeJS backend is using TypeORM to connect to the database
The dedicated administrator connection is a different kind of connection. It's not just "a connection being made by someone with administrative access". You would use the DAC when the SQL instance is having some kind problem, and you can't connect at all because resources are all tied up. SQL will reserve some resources especially for the DAC connection to make sure you can still connect.
A DAC connection can be made by specifying ADMIN: as part of your connection string, which will connect to the assigned DAC port.
You shouldn't use this for "routine" admin work. Just connect using a login with the required administrative server roles (eg, sysadmin). You definitely shouldn't use this as part of a regular application's connection string. You shouldn't be using a SQL Server sysadmin login either. Create a user with the appropriate permissions for your application, and don't use the admin connection.
Regarding your second issue: Make sure the instance wasn't set to start in single user or minimum configuration mode using startup flags. Note that this is for the whole instance, it's not the same as the configuration for an individual database.

Application deployment failed when connecting with the database

I have just finished the development of my application on asp.net mvc connected with SQL server, and I will love to deploy it. I want to use Azure App service, but I got an error "Unable to connect to master or target server 'DATABASE_NAME'. You must have a user with the same password in master or target server 'DATABASE_NAME'". I have tried every thing I found online like modifying the SSDT, but nothing changed.
Please is there any recommendation to fix this issue? If not, Please what are other ways for me to launch the application. The application will be used internally for Sales purpose and I don't need any fancy hosting. Thank you in advance.
Did you setup the sql azure firewall to accept connections from your computer?
Even if you set it up once, it is possible that your internet provider attributed a different IP address to your computer. So you must redo your firewall set up again for your computer to be accepted.
It is important to know that only sql logins/passwords are accepted here. So you must give the login/password of the admin user that you mentioned at the moment of creation of you sql server azure (there is a step that sets it up when you create your azure database), or the login/password of a user you created and granted in this database.

Moving DotNetNuke From Local To Host

I have installed DotNetNuke 5.6 on my local drive,now i want to move it to host to run web site. What steps should I do to run my web site?
If you haven't done anything to the site on your localhost, it might be easiest to have your host install a clean copy of DotNetNuke to a site for you. Many hosts will do that for you or provide automated tools to install it through their control panel.
In order to help you move a DotNetNuke site, we really need more details in order to provide a complete answer (your hosting company should be able to give you guidance) but the basics are:
1a. If you are just using SQL Express on the local host and plan to
use it under SQL Express on the host as well, you'll just need to
FTP up the DB files along with all the other files.
1b. If you'll be
running the DB under a full SQL Server: Backup your database on your
localhost, copy the DB backup to your host, and restore the database
to the database server provided by the host.
2. Create a blank website on the host.
3. FTP all site files from your localhost to the root directory of your new website.
4. Make sure the Network Service account has Full Access permissions to the root directory and all sub-directories.
5. If you're using a full SQL Server, you'll need to update connection strings in the web.config to point to the restored DB and
ensure you're using a user/login with read/write rights to the DB.
6. Browse to the site.
That should do it.

Steps to run an SQL Server database application

I need to run my application on network. The application is based on SQL Server DB.
I have created my databases and stored them in the data directory of my application. Setup shall copy them to the application folder. Upto here it is fine. Please guide me about the following:
1) I guide my user to attach the databases to SQLExpress instance of the server and give all access from SSMS. Am I right?
2) Then user installs application on on client computer. I can set it so that application prompts for server name where to connect to access the data.
How to get this name? How can I know how the user has setup the SQL Server Express and what instances has been made?
3) If I use .\SQLExpress as server name and instance, will it work? What if there are more than one servers installed. Where will my .\ take my connection to?
4) What if there is already an instance in the Client's computer. Will my .\SQLExpress portion still go to server or try to find the database on local computer?
Off course database is not attached on local computer and there will be an error.
I am really confused. Please help.
Thanks a lot.
Yes, but the user should have rights to do that and have to know how to do that.
You should try to connect to DB or leave it on user's responsibility - to provide a valid sql server instance address
Instead of dot (.) use real name of computer or its IP address, and you'll never be confused:
COMPUTERNAME\SqlExpress
If you properly set up the connection string - the app will never interfere with other instances of Sql Server anywhere

Why is Windows authentication using wrong username?

We have an ASP site using Windows authentication to connect to a SQLServer database. There are three instances of the web site, a Dev environment (located on my Workstation), an UAT environment and a production environment, which are on separate servers.
When I access the Dev site (which uses the same DB as the UAT site) I have no issues, the site connects to the database using my Windows account. However when I connect to the UAT site, it uses a different account (one which belongs to me but is not connected to my default Windows login) which is not permissioned on the DB, so the site returns the following error:
Microsoft OLE DB Provider for SQL
Server error '80004005'
Cannot open database requested in login 'ANAML'. Login fails.
/inc/dbconnect.asp, line 4
The ASP files on the Dev and UAT sites are identical, so can anyone explain why the UAT site might be using the incorrect Windows account? This only affects me, from all workstations, and no other users.
Have rebooted the server and my workstation, and cleared my internet files locally.
I found the answer at this page on ServerFault. Seems the login details for the UAT server had been stored in the Users control panel at some point. Deleting the relevant entry in the control panel restored the correct login when connecting to the website.
Well, my ASP knowledge has mostly faded but I'll see what comes out of my brain. My first thought would be that the Virtual Directory security is configured differently on the server where it is failing. It sounds like you would need it to be set to "Integrated Windows Authentication" only.
If that is set correctly then I'd ask about your connection string. Does your connection string specify Trusted Connection (e.g. it does not specify a username and password)?
Where does the ANAML account come from? Is it a SQL only login or is it a windows account?

Resources