0

嘿,我是 MVC 的新手,我正在尝试在 mvc4 中创建一个演示应用程序,描述如下

  1. 创建一个包含五个字段的视图

    (a) 学生姓名

    (b) 学生父亲姓名

    (c)学生母亲姓名

    (d) 学生班

    (e)学生组

其中学生姓名、学生父亲姓名、学生母亲姓名保存到 Student_Personal_Information 表中,学生班级和学生部分保存到 Student_School_Information 表中。

  1. 在 SQL Server 中使用以下字段创建两个表

    (a) 在 Student_Personal_Information 表中

    (I) Student_Id int (identity)(Primary Key)
    
    (II) Student_Name varchar(200)
    

    (三) Student_Father_Name varchar(200)

    (IV) Student_Mother_Name varchar(200)

    (b) 在 Student_School_Information 表中

    (一)Student_Class_Id(身份)(主键)

    (II) Student_Id int (FK with Student_Personal_Information 表的 Student_Id 列)

    (三) Student_Class varchar(20)

    (四) Student_Section varchar(5)

注意:- 这些数据在存储过程的帮助下保存在表中

现在我的问题是如何使用 MVC4 将所有字段数据保存在两个单独的(Student_Personal_Information 和 Student_School_Information)表中。

现在我正在编辑我的问题

我也在创建一个局部视图,并将 Student Class 和 Student Section 字段设置为局部(强类型)视图,现在我该如何完成我的任务

任何帮助将不胜感激!

4

1 回答 1

0
      1.Create a view with five fields 

(a) 学生姓名

(b) 学生父亲姓名

(c)学生母亲姓名

(d) 学生班

(e)学生组

       **strong text**
   Now when  submit your View i.e form   and access the model values in your controller . 

    and pass the model values separately to your Tables Like below . 

        Student_Personal_Information.Name = model.Name  
        Student_Personal_Information.FatherName = model.FatherName                Student_Personal_Information.MotherName = model.MotherName             

 and rest of details in another table 

    Student_School_Information.Class=model.class

Student_School_Information.Section=model.Section

  Hope This helps you. 
于 2013-09-09T11:35:46.827 回答