in .net what class(s) should I use to make working with data from DB easy (not including Entity Framework or LINQ)
QUESTION 1 - What .NET classes should I be looking at to help me read / update some data in a database, but assuming I'm not using LINQ or Entity Framework. That is if you drop back to the core .net framework what are the key classes to use.
In particular something that lets me access data from table X via use of C#/object type approach (as opposed to SQL)? I just need to do things like:
- r1 = record from Table X where the description = 开发者_如何学Go"xyz"
- r2 = records from Table X where TableX.ref_id = TableY.id
QUESTION 2 - If there no existing .net classes for this beyond going to LINQ / Entity Framework, then can I ask is there a way say, to do a SQL search in a table and identify 1 specific record, and then load this into a .net class that represents the row? e.g. has the same attributes in the class instance as in the database? Which .Net classes would let me do this. If this isn't possible then I assume it's a matter of creating your own data class and writing a manual function to load the data into it?
thanks
You want to use ADO.NET:
ADO.NET is an object-oriented set of libraries that allows you to interact with data sources. Commonly, the data source is a database, but it could also be a text file, an Excel spreadsheet, or an XML file. For the purposes of this tutorial, we will look at ADO.NET as a way to interact with a data base.
精彩评论