Thursday, May 4, 2023

what are the feature provided by .net core?

 ASP.NET Core MVC provides features to build web APIs and web apps:

1.The Model-View-Controller (MVC) pattern helps make your web APIs and web apps testable.

2.Razor Pages is a page-based programming model that makes building web UI easier and more productive.

3.Razor markup provides a productive syntax for Razor Pages and MVC views.

4.Tag Helpers enable server-side code to participate in creating and rendering HTML elements in Razor files.

5.Built-in support for multiple data formats and content negotiation lets your web APIs reach a broad range of clients, including browsers and mobile devices.

6.Model binding automatically maps data from HTTP requests to action method parameters.

7. Model validation automatically performs client-side and server-side validation.

What is .NET Core used for?

 ASP.NET Core is a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps. With ASP.NET Core, you can: Build web apps and services, Internet of Things (IoT) apps, and mobile backends.

DCL commands

DCL COMMANDS:

1. GRANT:

It is used to give user access privileges to a database.

Syntax:

GRANT SELECT, UPDATE ON MY TABLE TO SOME_USER, ANOTHER_USER;

2. REVOKE:

GRANT SELECT, UPDATE ON MY TABLE TO SOME USER< ANOTHER_USER;

Syntax:

REVOKE SELECT, UPDATE ON MY TABLE FROM USER!, USER2;

TCL commands

TCL COMMANDS:

1. COMMIT:

Commits a Transaction. The COMMIT command saves all the transactions to the database since the last COMMIT or ROLLBACK command.

Syntax: COMMIT;

Example:

DELETE FROM Student WHERE AGE = 21; COMMIT:

2. ROLLBACK:

If any error occurs with any of the SQL-grouped statements, all changes need to be aborted. The process of reversing changes is called rollback

Syntax: ROLLBACK;

Example:

DELETE FROM Student WHERE AGE = 21; ROLLBACK;

DML commands

DML COMMANDS:

1. INSERT:

SQL INSERT statement is a SQL query. It is used to insert a single or a multiple records in a table.

Syntax:

INSERT INTO table_name

VALUES (value1, value2, value3 .....);

Example:

INSERT INTO STUDENTS (ROLL_NO, NAME, AGE, CITY) VALUES (1,naresh, 21, hyd)
3. ALTER:

The ALTER TABLE statement in Structured Query Language allows you to add, modify, and delete columns of an existing table.

Syntax:

ALTER table_name

ADD column_name datatype;

Example:

ALTER TABLE EMPLOYEE ADD Email varchar (255);

4. DROP:

The DROP TABLE statement is used to drop an existing table in a database. This command deletes both the structure & Records Stored in the table.

Syntax:

DROP TABLE table_name;

Example:

DROP TABLE Employee

DDL commands

DDL COMMANDS:

• DTM (Data Defined Languages) used to change the structure of the table Like creating the table, altering the table & Deleting the table.

All the commands in the DDL are auto Committed that means it permanently save all the changes in the database.

1. CREATE :

This command is used to create a new database or table.

Syntax:

CREATE TABLE table_name( columnl datatype, column2 datatype, column3 datatype,

Example:

CREATE TABLE Employee

EmployeelD int; FirstName varchar(255), LastName varchar(255), AddressLine varchar(255), City varchar(255)

);
2. UPDATE:

The UPDATE statement is used to modify the existing records in a table.

Syntax:

UPDATE table_name

SET colomn1 = value1, colomn2 = value2,..... WHARE CustomerID = 101;

Example:

UPDATE Customers

SET ContactName = 'naresh', City = 'hyd' WHERE CustomerID = 101;

3. DELETE :

The DELETE statement is used to delete the existing records in a table.

Syntax:

DELETE FROM table_name[WHERE condition];

Example:

DELETE Customers WHERE CuntomerName = "naresh";
4. TRUNCATE:

A truncate SQL statement is used to remove all rows (complete data) from a table. It is similar to the DELETE statement with no WHERE clause.

Syntax:

TRUNCATE TABLE table_name;

Example:

TRUNCATE TABLE Employee;

what is SQL ?


sql is stand for structured query language.

• This database language is mainly designed for maintaining the data in relational database management systems.

• sql is standard language for accessing and manipulating database

Sunday, April 2, 2023

This site can't be reached error

Solution 1:

  1. open cmd as admin
  2. cd C:\Program Files (x86)\IIS Express
  3. IisExpressAdminCmd.exe setupsslUrl -url:https://localhost:portnumber/ -UseSelfSigned
Solution 2:


Tuesday, January 3, 2023

exception has been thrown by the target of an invocation in c#

 changes dll version or upgrade dll .. change old dll library to new dll library

...\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll

Friday, December 9, 2022

Database from SINGLE USER mode to MULTI USER

 USE master;

GO

ALTER DATABASE MyDb2022

SET SINGLE_USER

WITH ROLLBACK IMMEDIATE;

GO

ALTER DATABASE MyDb2022

SET READ_ONLY;

GO