Sorry if my question is too basic, I can't figure out that in the code when I write:
var myItem = Sitecore.Context.Database.GetItem("....");
Which database is used in this case, either Master Db or Web Db ? In this link, "Context Class" its written that, "The Context object holds information about the current state such as current database, current language, current domain etc."
How do I know what is current? e.g. Current Database
Sitecore data is stored in multiple databases. From a web developer’s perspective, the two most often used ones are master, which contains the data being edited in the Content Manager, and web which is storing the data used to display the web site.
Databases can be accessed through the Database class. To obtain a reference to a database, use the Factory class, as in:
Sitecore.Data.Database master =
Sitecore.Configuration.Factory.GetDatabase("master");
The database names and implementation details are specified in the web.config below the section.
Whenever the user code is invoked by Sitecore, a so called context database is automatically assigned. You can access this database by using the Context class, as in:
Sitecore.Data.Database current = Sitecore.Context.Database;
When the code executes on the web site (that is in a layout or an xsl extension), the context database will be web. When code is executing within the Content Manager, the context database will be core. The core database contains data needed by the Content Manager.
To access the database being edited within the Content Manager, you can use
Database content = Sitecore.Context.ContentDatabase;
The ContentDatabase property will be empty when executing in the web site context. Only content editors (such as the Content Manager) will normally support this property.