Carl,
Cor is not giving you the correct information. See my input below.
Carl,
You mean probably development PC with development database and how can you
deploy that.
It is of course first a kind of correct setting of the IIS for both
environments what is more IIS than AdoNet.
To deploy an aspnet application is in VSNet by the way possible by the
option in Project Copy project. The problem is that it copies everything
what you don't want, so making your own deployment for that using the
deployment tools or just using copy. Samples are on MSDN.
You can deploy your Web project from VS .NET by using Copy Project as Cor says,
but if you set the "Only files needed to run this application" radio button,
only the files needed to run the application (Web Application) will be copied to
the web site. The *.cs files and the other files will not be copied. None of
the files not needed on the web site will be copied.
The last problem is your database.
For that is only the connectionstringimportant.
You can in every place in your program set the connectionstring to the
connection.
While it recommended to open and close as much as possible. Is that not a
problem at all in my opinion.
(When you use the designer to create connections, don't than change settings
in that in the designer part. That gives only trouble.)
This is bad advice. Closing the connection when the user of the database on a
web site relieves the web sites database of the heavy burden of keeping
connections open. When you use a database on a web site (or anywhere else) you
cannot be sure how many users will be connected. This makes it important for
you to close your connections when they are not needed.
As for the connection to the database, you can set this up in your web.config
file. Look at the properties of your connection object in the IDE and find the
"DynamicProperties" menu item and proceed from there. Once you have done this,
you can change the Connection string of every connection in the web application
by simply changing the Web.config connection string.
When you use the connection to your database in the designer, hopefully you are
not connected to a "production" database. Typically you will be only connected
to the database on your development machine. That is why Cor believes it is OK
to keep the connection open, but in the real world, you should never develop
against a "production" database.
The answer to the question you asked about the database depends on whether the
database exists at the web site. If it does and you have permissions to create
tables, stored procedures, etc., then you will probably want to make a creation
script for all of the objects in the development database and then run it
against the database on the web server.
You can do this in one operation if you have the SQL Server Enterprise Manager,
by using the Copy Database Wizard (right click on Database and choose "Copy
Database Wizard..." from the context menu.
Otis Mukinfus
http://www.otismukinfus.com