Target audience
Beginners learning MVC and want to save a from record into database using ajax.Table Structure
Store Procedure
USE[Girfa_DB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTERProc[dbo].[AddRecord]
(
@rollbigint,
@namevarchar(20),
@cityvarchar(20)
)
AS
BEGIN
SETNOCOUNTON;
INSERTintoStudent(roll,Name,City)values(@roll,@name,@city)
SETNOCOUNTOFF;
END
Model
publicclassStudentModel
{
publicint Roll { get; set; }
publicstring Name { get; set; }