使用N层架构的CRUD屏幕

时间:2021-11-11 02:21:53

net page with lot of controls and validations. I need to allow users to Save the application into the database.

具有大量控件和验证的网页。我需要允许用户将应用程序保存到数据库中。

I have a Master table Called Customer and 5 different child tables with Customer_ID being foreign key.

我有一个名为Customer的Master表和5个不同的子表,Customer_ID是外键。

Once the user hits save I need to insert a record into customer table and then insert records into relevent child tables with the just created customer_ID.

一旦用户点击保存,我需要将记录插入到customer表中,然后使用刚创建的customer_ID将记录插入到相关的子表中。

Can you guys suggest me a good example of the above mentioned scenario that would be of great help.

你们能不能给我一个很好的例子来说明上面提到的场景会有很大的帮助。

I created a model for Customer and all the child tables. But I really don;t know how to proceed from here.

我为Customer和所有子表创建了一个模型。但我真的不知道如何从这里开始。

I am using VB.net and ASP.net 2.0 and oracle 8g. We cannot use the ASP.net 3.5 or MVC 1.0.

我使用的是VB.net和ASP.net 2.0以及oracle 8g。我们不能使用ASP.net 3.5或MVC 1.0。

Please help

Thanks a ton.

万分感谢。

2 个解决方案

#1


The ASP.NET website has a wealth of examples.

ASP.NET网站有很多例子。

http://www.asp.net/learn/data-access/

#2


One thing I would definitely do is make sure you use transactions to ensure data integrity. The transactions could be within a stored procedure or using the .NET transaction classes. Either way, you want to make sure that if there is an exception when saving your data that the database is rolled back to a consistent state.

我肯定会做的一件事是确保使用事务来确保数据的完整性。事务可以在存储过程中使用,也可以使用.NET事务类。无论哪种方式,您都希望确保在保存数据时存在异常,以使数据库回滚到一致状态。

#1


The ASP.NET website has a wealth of examples.

ASP.NET网站有很多例子。

http://www.asp.net/learn/data-access/

#2


One thing I would definitely do is make sure you use transactions to ensure data integrity. The transactions could be within a stored procedure or using the .NET transaction classes. Either way, you want to make sure that if there is an exception when saving your data that the database is rolled back to a consistent state.

我肯定会做的一件事是确保使用事务来确保数据的完整性。事务可以在存储过程中使用,也可以使用.NET事务类。无论哪种方式,您都希望确保在保存数据时存在异常,以使数据库回滚到一致状态。