Coder Baba
2.42K subscribers
1.01K photos
23 videos
722 files
723 links
Everything about programming for beginners.
1 and only official telegram channel of CODERBABA India.

Content:
.NET Developer,
Programming (ASP. NET, VB. NET, C#, SQL Server),
& Projects
follow me https://linktr.ee/coderbaba
*Programming
*Coding
*Note
Download Telegram
TempData Vs Session in ASP .NET MVC:

πŸ‘‰πŸ»TempData

βœ…TempData allow us to persisting data for the duration of single subsequent request.
βœ…ASP. net MVC will automatically expire the value of tempdata once consecutive request returned the result (it means, it alive only till the target view is fully loaded).
βœ…It valid for only current and subsequent request only
βœ…TempData has Keep method to retention the value of TempData.

Example:

TempData.Keep(), TempData.Keep(β€œEmpName”)

βœ…TempData internally stored the value in to Session variable.

βœ…It is used to stored only one time messages like validation messages, error messages etc.

πŸ‘‰πŸ»Session:

⚑️Session is able to store data much more long time, until user session is not expire.
⚑️Session will be expire after the session time out occurred.
⚑️It valid for all requests.
⚑️N/A
⚑️Session variable are stored in SessionStateItemCollection object (Which is exposed through the HttpContext.Session property of page).
⚑️It is used to stored long life data like user id, role id etc. which required throughout user session.
⚑️TempData and session, both required typecasting for getting data and check for null values to avoid run time exception.
Don't forget to understand these essential SQL topics if you're just starting out.

1. SQL Basics
- SELECT Statement:
It's like asking the database for specific information.
- FROM Clause:
Tells the database where to look for that information.
- WHERE Clause:
Filters out the stuff you don't need.
- ORDER BY Clause:
Arranges the results in a specific order.

2. Data Manipulation
- INSERT: Adds new data.
- UPDATE: Changes existing data.
- DELETE: Removes data.
- MERGE: Combines these actions.

3. Data Definition
- CREATE TABLE: Makes a new table.
- ALTER TABLE: Edits an existing table.
- DROP TABLE: Deletes a table.
- INDEXES: Helps with finding data quickly.

4. Constraints
- PRIMARY KEY: Ensures each row is unique.
- FOREIGN KEY: Keeps data relationships intact.
- UNIQUE: Ensures values are unique.
- DEFAULT: Sets a value if none is given.

5. Joins (Really Important)
- INNER JOIN: Combines data from different tables.
- LEFT JOIN: Gets all data from one table and matching data from another.
- RIGHT JOIN: Opposite of LEFT JOIN.
- FULL JOIN: Gets data if it's in either table.
- SELF JOIN: Links data within the same table.

6. Subqueries:
- Correlated Subqueries: Subqueries connected to the main query.
- Scalar Subqueries: Subqueries that return a single value.
- Subquery in FROM Clause: Using a subquery as a table.

7. Aggregation Functions:
- SUM, COUNT, AVG, MAX, MIN: Math on groups of data.
- GROUP BY: Groups data before doing math.
- HAVING: Filters groups based on math results.

8. Views:
- CREATE VIEW: Makes a pretend table.
- ALTER VIEW: Changes the pretend table.
- DROP VIEW: Deletes the pretend table.

9. Transactions:
- BEGIN TRANSACTION, COMMIT, ROLLBACK: Ensures data stays safe and consistent.
- ACID Properties (Important): Rules for safe transactions.

10. Database Security:
- GRANT and REVOKE: Decides who can do what.
- Roles: Groups of permissions for users.

11. Normalization (Important):
- 1NF, 2NF, 3NF, BCNF, 4NF:
Ways to organize data for efficiency and accuracy.

12. Indexes:
- Clustered vs. Non-Clustered Indexes: Different ways to find data quickly.

13. Database Management Systems (DBMS):
- Different software tools for working with databases, like MySQL etc.