I have a silverlight web project using LinqToSql for database connection. I developed it on my local SQL box using the local name of database. Now, when i deploy it on my production web server, do i have to recompile the code again to change the connection string for production db or just changing the db name in web.config will work.
Also, do i have to give specific username/password in the web.config file or dbml will pick that from IIS AppPool.
When you create your app in .net 4, you will get 3 web.config.
the live connection string should be put into the web.live.config.
just search for it for guidelines.
You dont have to recompile, but you have to point your linq to sql default constructor to use the connection string from web.conf
in web.conf use the connection sring with user name and password for the new server and you will not have to set password or username any where else.
please refer to this article for more help
http://aspilham.blogspot.com/2011/01/how-do-i-set-connection-string-in-linq.html
Related
So basically I have a SQLite3 Database that I am using for a Discord Bot. Is it possible for me to access my database file to check what's inside while the application is hosted and live?
I've considered that it is probably possible to do this from the command line within my terminal that I use to access the virtual host, but I do not know where to begin/what to input.
Ideally I would want to be able to view the file inside the DB Browser for SQLite program, for visual purposes, but for starters I want to know if its possible to see the live-updated database remotely, as my application is hosted on a virtual host/machine.
You can install phpliteadmin (https://www.phpliteadmin.org/) on your server to view your database.
Otherwise your can download your database file and view it in a client (Example of online client: https://extendsclass.com/sqlite-browser.html)
I'm a newbie in NodeJS. In my first project, I use mongoose to connect local database. I want deploy it on Heroku Cloud. I search guide to do it. Everything is OK but when I load my page, it has error like picture.
I think the reason is there is no add-on for MongoDB in my app. Heroku has 2 Data Stories for MongoDB is Compose MongoDB and mLab. But both need to verify my account credit card.
What can I do now?
Thank for your help!!!
Error
Setting up MongoLab manually
You dont have to use the Heroku add-on system if you dont want to. What you really want to do is to set up a MongoDB database in the cloud and get a connection string for it.
You can follow through the MongoLab documentation to guide you through this: mongoLab
In short, the steps are:
Sign up for a free account
Create a new database (select Single Node, Sandbox for the free tier)
click on newly created DB Add a user
Get the Database URI (connection string given at top)
The connection string will look something like this:
mongodb://dbuser:dbpassword#ds059957.mongolab.com:59957/loc8r-dev
All of the parts will be different for you of course, and you 'll have to swap out the username and password with what you specified in step 3.
Once you have your full connection string you should save it as part of your Heroku config. With a terminal prompt in the root folder of your application you can do this with the following command:
$ heroku config:set MONGOLAB_URI=your_db_uri
Replace your_db_uri with your full connection string, including the mongodb:// protocol. The quick and easy way automatically creates the MONGOLAB_URI setting in your Heroku config. These manual steps bring us to the same point as the quick way, and you can now jump back to the main text in the Breaking the URI down into its components section.
I published my NopCommerce application to azure. as you may know connection string is defined in the settings.txt file under the app_data. It is also published with all files but strange thing is that when I open the settings.txt file. connections string is removed.
It should look like this
DataProvider: SQL Server CE
DataConnectionString: Data Source=|DataDirectory|\Nop.Db.sdf;Persist Security Info=False
but published version looks like that
DataProvider:
DataConnectionString:
Any idea why is that happening? or is there another way to copy directly? I am new on Azure and I couldn't find published files even.
Thanks
you can see the file system and edit \ upload files by using the SCM endpoint, there is good information in this blog: http://blogs.staykov.net/2013/12/windows-azure-secrets-of-web-site.html
Basically you take the url for your site http://<your_site>.azurewebsites.net and add scm to the url so it will be: http://<your_site>.scm.azurewebsites.net. Browsing to this location will give you access to a file browser as well as a set of diagnostics tools.
I have backed up the Kentico Database and website from one of our Live servers and placed it within our Dev server and configured the website in IIS.
When I navigate to the website, it currently asks for New installation.. Whereas it should just show me the current website.
How do I get it to show the website?
EDIT
The following error occurs when going ahead and creating a new instance with the restored Database:
Restore the backed up database and add database connection string to the web.config of the application. Simple as that :)
Who or what is set as the DB objects owner/schema in the DB? Does this match the setting in Site Manager (or, CMS_SettingsKey table)? I would make sure these two match.
Another option is that the connection string was not initialized by .Net - I would do a dummy change in the web.config file to force the app restart and/or also clearing the .Net cache.
In my project I declare the one string like public string str="dbname";,
that string value use the overall application.
Where can I declare that string?
Another problem is that I can change that string value after publishing the site in iis,
(or)
I am giving client that time also change the string value, so where I can declare the variable?
please give me any suggestion.
dbname is string value so i can chage that name after publishing or any time
thank u
hemanth
DBName is something that belongs in a configuration file. ASP.NET uses files that are called web.config and they can store 'Connection strings', Application specific settings and other settings.
A configuration file can be edited after the program has been deployed to a production server. You can even automate this process so the settings are automatically set if you, for example, deploy to a test server, an acceptance or a production server.
Here is some documentation about how to use configuration files.
You have a client/server architecture?
You want your server application to use a global variable str?
You want your client application (which is a webinterface?) to change str?