I have one web site and I want to upload it on server and i also want to upload the ms sql database with that web pages. Please tell me how to upload it on web server....
This is a rather generic question because there could be a lot of different problems and differences, but generally, you would take a backup of your server first. Here is some general information on that:
http://msdn.microsoft.com/en-us/library/ms187510.aspx
Then log into your hosting provider, create a database using their tools, and restore your database backup to that new hosted database.
Next you would change where your database config in your files is pointing to the new database, then use an ftp client like Filezilla to ftp into your web server. The hosting provider should be able to give you the username and password. Upload the web pages / files to the public directory (usually /public or /htdocs or something along those lines).
Related
Is it possible to rename/move or delete files from a web application (ASP.Net MVC) that are on a server folder just like how you would do it locally? I would want the user to be able to upload say 30 files (from a scanner auto-feed) into a temporary folder on the server (cannot save it locally due to data security) and then allow the user to be able to rename /move before uploading them onto Azure blob storage.
I saw few examples - jquery file tree seemed good but not sure if it allows rename and moving. Please suggest solutions for working with the server folder. I intend to delete the server folder after I am done transferring files to Azure. TIA.
Yes, you can do this by giving the USER that is running the ASP.Net application (defaults to IUSR) permissions to write to that folder.
Be very careful though, as you're potentially opening your website for abuse when doing this.
See: https://www.iis.net/learn/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis for how IIS users operate.
I made an ASP.NET web site using visual studio 2012. I registered a free domain and now I need to upload the project using for example FileZilla. Can you tell me which files exctly should I upload and do I need to set a starting page in my project or I need a Default.aspx page in it. I also have an MSSQL database. Any suggestions how to upload it?
If you can publish your code using this - right click on project , select publish, choose filesystem , and then save published code to target file system and then copy that directory to required domain using FileZilla. Also you can directly copy solution project , but it is recommended to host published code.
You can set startup page using web.config - Set Default Page in Asp.net
Regarding DB thing - you need to make sure, required domain has MSSQL, if that has, then copy required DB and attach to DB server, extract connection string ( DB server address, DB name , credential) and update that in web.config of hosted website.
I am new to SQL Server databases. I used a SQL Server database in my website (I add it to my project by add new Item and now it is located in a App_Data folder). I can show the needed information of it in a gridview on my localhost but when I upload it on the web hosting server, I can not access it.
What is wrong with it? You can see it here: http://www.kaj.somee.com/SL.aspx
I'm using asp.net 2010 and vb.net
There is the error. See your excerpt (per comment). Do you really have your app_data folder in path
AttachDbFilename=C:\Users\Javad\Desktop\Sharj\App_Data\ShDB.mdf
Does this path really exist in your hosting machine. I believe NO and in that case Change that path accordingly.
Every where I read of being able to "Upload files from the client PC to the Server" but HOW will you do this if you don't have access to the clients directories?
How will the client select what files to upload if the server does not have access to them?
Links on How to do this.
C#, Asp.net Uploading files to file server…?
Uploading files to a web server with ASP.Net
Uploading In ASP.NET
My Previous question telling me that the server does not have access to the client pc/directories
--UPDATE--
So thanks to the comments and answers I Understand now.
The server CANNOT access directories and files on the client. BUT
The client can push through files to the client that can then use the
files.
You need an upload control, so that the user can upload files manually. If you want to pull files from the user's PC without interaction with the user, then ASP.net won't do that for you. You should look into WCF or other frameworks.
I'm taking the database that I created with SQL server express and putting it on a server in a datacenter. There are 2 database files in AppData folder: the aspnetdb.mdf file and the file I created for my site MySite.mdf. I'm using the ASP login control and that works with the ASPNETDB.mdf file and it's working. If I log in without the correct username/pwd, it'll display a bad login message.
However, as soon as I login and the site goes to make a request to MySite.mdf, I get an error "Invalid object name 'dbo.Users'." which is the name of the first table the site looks into after the login.
I've attached the MySite.mdf file to the server and copied the connection string the hosting company is generating into the web.config file and left the rest as is.
Could it be that I can't attach a sql express file?
Please let me know if you've run into this issue or if you have any suggestions.
Thanks.
Based on your description and the following assumptions:
your authentication still works
you haven't mentioned attaching your aspnet.mdf
you have separate databases for security and datastore
you're probably still testing locally
I'd guess that your application is still pointing at your local aspnet database - that's why authentication still works. Typically in a shared host, you'll have to install/insert the asp.net security database items to your main database. See This MSDN page for instructions on setting up the asp.net database objects.
You need to establish whether or not you've actually attached your database or not. Is there an online "database manager" you can access? Or can you connect to your database from SSMS or your dev environment and run a simple query?