1. ViewData ViewBag tempdata difference?
1, ViewData and TempData is the dictionary type, the method of assignment dictionary, viewdata["MyName"] 2, ViewBag is a dynamic type, when using the direct Add property assignment can Viewbag.myname
3, ViewBag and ViewData are only valid in the current action, equivalent to the view
4, TempData can continue to use by turning, because its value is stored in the session. However, TempData can only be passed once and then automatically cleared by the system.
5. Values in ViewData and viewbag can be accessed by each other because the ViewBag implementation contains ViewData
6. ViewData is available in ASP. NET MVC 1, and ViewBag in ASP. 3
7. ViewData faster than ViewBag
2. Public private protected internal protected internal difference?
Public: Publicly-owned members, not restricted by access
Private: Privately-owned member, accessible only within that internal access, not externally accessible
Protected: Protected Member, accessible only in this class or its subclasses
Internal: Accessible in the same namespace (assembly) (including subclasses and non-subclasses)
Protected internal: (subclass only) when the parent class is in the same assembly as the child class, the internal member is visible, when the parent class is not in the same assembly as the child class, the child class cannot access the internal member of the parent class, and the child class can access the internal member of the parent class.
3. Left joins, right joins, Inner joins, full joins, Cross joins
The LEFT join and right join are outer joins, the inner join is an inner join, and the cross join is the Cartesian product
In the left JOIN, the table is the main table, the right table is from the table, the main table data is all displayed, and the data from the table shows only the associated part matching data, with no matching data with null completion
Inner joins show only data that matches the conditions of the two tables
Full join will get all rows of data in two tables, and the last matching column will be displayed as null
Cross join Cartesian product will return each element in a to match the result of all elements in B, that is, the n*m combination
4. Index types for SQL Server databases
1. Primary KEY index: Defining a primary key for a table in a database diagram automatically creates a primary key index, which is a special type of unique index. The primary key index requires that each value in the primary key be unique. It also allows for fast access to data when a primary key index is used in a query
2. Unique index: A table can have multiple distinct unique indexes, and a unique index does not allow two rows to have the same index value.
3. Clustered index: The physical order of the rows in the table is the same as the logical order of the key Values (index order)
4 Nonclustered indexes: the physical order of the rows in the table differs from the index order, and the clustered index has a faster access rate than the nonclustered index.
Only one clustered index, multiple nonclustered indexes, can be created in a table.
5. What is the difference between JQuery Window.onload and Document.ready ()?
1. Window.onload must wait until the page includes the image, the CSS is loaded, and the Document.ready () is executed after the DOM structure has been drawn and does not have to wait until the loading is complete
2. Window.onload () cannot write multiple at the same time, if there are multiple, only one will be executed, Document.ready () can write multiple, and can be executed
ASP. NET Base Content