简体   繁体   English

什么是dao等效于在c#.net中插入和编辑记录?

[英]what is the dao equivalent to inserting and editing records in c# .net?

I was wondering if there is an equivalent to the DAO style insert and update record code in C#. 我想知道在C#中是否有等效于DAO样式的插入和更新记录代码。 For instance, in access VBA, I could do an insert with something like this: 例如,在Access VBA中,我可以使用以下内容进行插入:

dim db As DAO.Database
dim rs As DAO.Recordset

Set db = CurrentDatabase
Set rs = db.OpenRecordset("tableName")

With rs
     .add
     .Fields("column1") = Textbox.Value
     .update
End With

Is there something similar in C# .net?? C#.net中有类似的东西吗? i know how to do it with parameterized queries, but for what I'm doing, it seems like the old DAO way would be quicker. 我知道如何使用参数化查询,但是对于我正在做的事情,似乎旧的DAO方法会更快。

Since VB.Net and C# .Net share the same framework... .Net it's pretty easy. 由于VB.Net和C#.Net共享相同的框架... .Net,因此非常容易。 It's going to look something like: 它看起来像:

DAO.Database db = CurrentDatabase(); 
DAO.Recordset rs = db.OpenRecordset("tableName");

rs.add();
rs.Fields["column1"] = Textbox.Value ;
rs.update();

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM