Search code examples
c#databaseoracledatasetodp.net

Perform operations on a database using a DataSet without caching


I'm very sorry if this is going to be a bad question. I've done very little database programming. This might be the time to read up on it from scratch, which I will probably do at some point, but I'm pressed for time right now.

Is there a way I can perform DataSet-like operations e.g. Inserts, Deletes, etc, on an Oracle database without caching a chunk of the database? I'm looking for something to avoid typing awkward SQL queries for objects with arbitrary fields/columns. Something where I could just define a DataRow and Insert it (or Update it based on some key). I don't see how I can do this with caching, since I can't possibly cache the whole database. It's pretty big.

Because the entities are largely arbitrary, I don't want to define static classes to wrap them.


Solution

  • If you are using typed DataSet You can provide parameters for your Fill methods. Making them fill DataTable with only the neccessary rows.

    If you are using DataReader you can provide any kind of query in your query string.

    Basicly You can 'cache' only the rows You want to change.