简体   繁体   English

仅在插入数据库时​​是否必须使用断开连接的方法?

[英]Do I have to use a disconnected approach when only inserting in a database?

We need to create a small website with a database (accdb) in ASP.NET. 我们需要在ASP.NET中创建一个带有数据库(accdb)的小型网站。 This database will only have records added while it's in operation (gathering survey data). 该数据库仅会在运行时添加记录(收集调查数据)。 Our teacher prefers to use DataSets (disconnected approach) for any database, but this is overkill for such a small website. 我们的老师更喜欢对任何数据库使用数据集(断开连接的方法),但这对于这么小的网站来说实在是太过分了。 This is why I was wondering, is there any reason not to use a connected approach (DataReader)? 这就是为什么我想知道,是否有任何理由不使用连接方法(DataReader)? Can any concurrency errors occur when only inserting? 仅插入时会发生任何并发错误吗?

In other words: connected or disconnected approach when you only insert into the database? 换句话说:连接或断开连接的方法何时只插入数据库?

技术答案是“否”,因为断开连接的方法对插入操作没有任何意义。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我只有比较字符串的某些部分时,如何使用string.StartsWith()? - How do I use string.StartsWith() when I only have some parts of the comparison string? C#多线程:仅从列表/字典中获取对象时,是否必须使用锁? - C# Multithreading: Do I have to use locks when only getting objects from a list/dictionary? 当我需要数组在C#中有一个间隔时,如何处理数组属性? - How do I approach array properties when I need an array to have an interval in C#? 在Entity Framework中使用数据库优先方法时,为什么会生成两个“ .tt”文件? - Why there are two “.tt” files generated when I use database first approach in Entity Framework? 我是否需要断开连接的实体? - Do I need disconnected entities? 多线程时是否必须锁定数据库连接? - Do I have to lock the database connections when multithreading? 我在Access数据库插入执行时间时遇到问题 - I have an issue with access database inserting execution time 我在SQL Server数据库中插入和删除行时遇到问题 - I have trouble inserting and deleting rows in my SQL Server database 我在将数据插入 MS Access 数据库时遇到问题 - I have a problem with inserting data into a MS Access database 如果我在此之前使用 EF 代码优先方法并执行 CRUD 操作,如何将更多表添加到数据库中。? - How to add table more table to database if I use EF code-first approach before this and do CRUD operation.?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM