Reputation: 12211
I was wondering if there is an equivalent to the DAO style insert and update record code in C#. For instance, in access VBA, I could do an insert with something like this:
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?? 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.
Upvotes: 1
Views: 1146
Reputation: 54638
Since VB.Net and C# .Net share the same framework... .Net it's pretty easy. 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();
Upvotes: 0