How to Insert and Bind Records

Posted by Jayakumars under ASP.NET MVC on 6/10/2014 | Points: 10 | Views : 572 | Status : [Member] [MVP] | Replies : 2
Hi
This is my Dbscript

CREATE TABLE [dbo].[customer1](
[CustID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](50) NULL,
[Address] [varchar](50) NULL,
[ContactNo] [varchar](50) NULL,
CONSTRAINT [PK_customer1] PRIMARY KEY CLUSTERED
(
[CustID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

here i need how to use dbml in mvc4 and insert and bind the records for html table

how will do this mvc4
any one solve this.

Mark as Answer if its helpful to you


Responses

Posted by: Sheonarayan on: 6/10/2014 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
First you create a Model under Models folder having properties as the fields of the database table. Then you can use dialogue box while adding Controller (to create views and necessary action methods), it is something like this http://www.dotnetfunda.com/articles/show/2578/introduction-to-scaffolding-in-visual-studio-2013-rc however this article explains the latest version of Visual Studio and ASP.NET MVC 5. In your case it will be something similar.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goud.Kv on: 6/10/2014 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hi Kumar,

Check out this article http://www.c-sharpcorner.com/UploadFile/3d39b4/crud-operations-using-linq-to-sql-in-mvc.
Hope this helps you out.

Thanks & Regards,
Krishna

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response